| java.lang.Object jargs.gnu.CmdLineParser
All known Subclasses: jargs.examples.gnu.AutoHelpParser,
CmdLineParser | public class CmdLineParser (Code) | | Largely GNU-compatible command-line options parser. Has short (-v) and
long-form (--verbose) option support, and also allows options with
associated values (-d 2, --debug 2, --debug=2). Option processing
can be explicitly terminated by the argument '--'.
author: Steve Purcell version: $Revision: 1.10 $ See Also: jargs.examples.gnu.OptionTest |
Inner Class :abstract public static class OptionException extends Exception | |
Inner Class :public static class UnknownOptionException extends OptionException | |
Inner Class :public static class UnknownSuboptionException extends UnknownOptionException | |
Inner Class :public static class NotFlagException extends UnknownOptionException | |
Inner Class :public static class IllegalOptionValueException extends OptionException | |
Inner Class :abstract public static class Option | |
addBooleanOption | final public Option addBooleanOption(char shortForm, String longForm)(Code) | | Convenience method for adding a boolean option.
the new Option |
addBooleanOption | final public Option addBooleanOption(String longForm)(Code) | | Convenience method for adding a boolean option.
the new Option |
addDoubleOption | final public Option addDoubleOption(char shortForm, String longForm)(Code) | | Convenience method for adding a double option.
the new Option |
addDoubleOption | final public Option addDoubleOption(String longForm)(Code) | | Convenience method for adding a double option.
the new Option |
addIntegerOption | final public Option addIntegerOption(char shortForm, String longForm)(Code) | | Convenience method for adding an integer option.
the new Option |
addIntegerOption | final public Option addIntegerOption(String longForm)(Code) | | Convenience method for adding an integer option.
the new Option |
addLongOption | final public Option addLongOption(char shortForm, String longForm)(Code) | | Convenience method for adding a long integer option.
the new Option |
addLongOption | final public Option addLongOption(String longForm)(Code) | | Convenience method for adding a long integer option.
the new Option |
addOption | final public Option addOption(Option opt)(Code) | | Add the specified Option to the list of accepted options
|
addStringOption | final public Option addStringOption(char shortForm, String longForm)(Code) | | Convenience method for adding a string option.
the new Option |
addStringOption | final public Option addStringOption(String longForm)(Code) | | Convenience method for adding a string option.
the new Option |
getOptionValue | final public Object getOptionValue(Option o, Object def)(Code) | | the parsed value of the given Option, or null if theoption was not set |
getOptionValues | final public Vector getOptionValues(Option option)(Code) | | A Vector giving the parsed values of all the occurrences of thegiven Option, or an empty Vector if the option was not set. |
getRemainingArgs | final public String[] getRemainingArgs()(Code) | | the non-option arguments |
parse | final public void parse(String[] argv) throws IllegalOptionValueException, UnknownOptionException(Code) | | Extract the options and non-option arguments from the given
list of command-line arguments. The default locale is used for
parsing options whose values might be locale-specific.
|
parse | final public void parse(String[] argv, Locale locale) throws IllegalOptionValueException, UnknownOptionException(Code) | | Extract the options and non-option arguments from the given
list of command-line arguments. The specified locale is used for
parsing options whose values might be locale-specific.
|
|
|