Java Reference
In-Depth Information
return
'?'
;
}
else
return
else
{
// Found non-argument non-option word in argv: end of options.
++
optind
;
done
=
true
true
;
return
return
DONE
;
}
}
/** Return optind, the index into args of the last option we looked at */
public
public
int
int
getOptInd
() {
return
return
optind
;
}
}
See Also
GetOpt
is an adequate tool for processing command-line options. You may come up with
something better and contribute it to the Java world; this is left as an exercise for the reader.
For another way of dealing with command lines, see the
Apache Commons Command Line
character in most places other than the MS-DOS command line:
String rootDir = "C:\\";
.
[
11
]
The Unix world has several variations on
getopt
; mine emulates the original AT&T version fairly
closely, with some frills such as long-name arguments.