Метод | Описание | |
---|---|---|
Getopt ( string progname, string argv, string optstring ) : System |
Construct a basic Getopt instance with the given input data. Note that this handles short options only.
|
|
Getopt ( string progname, string argv, string optstring, |
Construct a Getopt instance with given input data that is capable of parsing long options as well as short.
|
|
Getopt ( string progname, string argv, string optstring, |
Construct a Getopt instance with given input data that is capable of parsing long options and short options. Contrary to what you might think, the flag longOnly does not determine whether or not we scan for only long arguments. Instead, a value of true here allows long arguments to start with a '
|
|
getopt ( ) : int |
This method returns a char that is the current option that has been parsed from the command line. If the option takes an argument, then the internal variable
|
Метод | Описание | |
---|---|---|
checkLongOption ( ) : int |
Check to see if an option is a valid long option. Called by getopt. Put in a separate method because this needs to be done twice. (The C getopt authors just copy-pasted the code!).
|
|
exchange ( string argv ) : void |
Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. This method is used by getopt for argument permutation.
|
public Getopt ( string progname, string argv, string optstring ) : System | ||
progname | string | /// The name to display as the program name when printing errors. /// |
argv | string | /// The string array passed as the command line to the program. /// |
optstring | string | /// A string containing a description of the valid args for this /// program. /// |
Результат | System |
public Getopt ( string progname, string argv, string optstring, |
||
progname | string | /// The name to display as the program name when printing errors. /// |
argv | string | /// The string array passed as the command ilne to the program. /// |
optstring | string | /// A string containing a description of the valid short args for this /// program. /// |
longOptions |
/// An array of |
|
Результат | System |
public Getopt ( string progname, string argv, string optstring, |
||
progname | string | /// The name to display as the program name when printing errors /// |
argv | string | /// The string array passed as the command ilne to the program. /// |
optstring | string | /// A string containing a description of the valid short args for this /// program. /// |
longOptions |
/// An array of |
|
longOnly | bool |
/// true if long options that do not conflict with short options can
/// start with a ' |
Результат | System |