jargs.gnu
public class CmdLineParser extends Object
Version: $Revision: 1.10 $
See Also: OptionTest
Nested Class Summary | |
---|---|
static class | CmdLineParser.IllegalOptionValueException
Thrown when an illegal or missing value is given by the user for
an option that takes a value. |
static class | CmdLineParser.NotFlagException
Thrown when the parsed commandline contains multiple concatenated
short options, such as -abcd, where one or more requires a value.
|
abstract static class | CmdLineParser.Option
Representation of a command-line option |
abstract static class | CmdLineParser.OptionException
Base class for exceptions that may be thrown when options are parsed |
static class | CmdLineParser.UnknownOptionException
Thrown when the parsed command-line contains an option that is not
recognised. |
static class | CmdLineParser.UnknownSuboptionException
Thrown when the parsed commandline contains multiple concatenated
short options, such as -abcd, where one is unknown.
|
Method Summary | |
---|---|
CmdLineParser.Option | addBooleanOption(char shortForm, String longForm)
Convenience method for adding a boolean option. |
CmdLineParser.Option | addBooleanOption(String longForm)
Convenience method for adding a boolean option. |
CmdLineParser.Option | addDoubleOption(char shortForm, String longForm)
Convenience method for adding a double option. |
CmdLineParser.Option | addDoubleOption(String longForm)
Convenience method for adding a double option. |
CmdLineParser.Option | addIntegerOption(char shortForm, String longForm)
Convenience method for adding an integer option. |
CmdLineParser.Option | addIntegerOption(String longForm)
Convenience method for adding an integer option. |
CmdLineParser.Option | addLongOption(char shortForm, String longForm)
Convenience method for adding a long integer option. |
CmdLineParser.Option | addLongOption(String longForm)
Convenience method for adding a long integer option. |
CmdLineParser.Option | addOption(CmdLineParser.Option opt)
Add the specified Option to the list of accepted options |
CmdLineParser.Option | addStringOption(char shortForm, String longForm)
Convenience method for adding a string option. |
CmdLineParser.Option | addStringOption(String longForm)
Convenience method for adding a string option. |
Object | getOptionValue(CmdLineParser.Option o)
Equivalent to getOptionValue(o,
null) . |
Object | getOptionValue(CmdLineParser.Option o, Object def) |
Vector | getOptionValues(CmdLineParser.Option option) |
String[] | getRemainingArgs() |
void | parse(String[] argv)
Extract the options and non-option arguments from the given
list of command-line arguments. |
void | parse(String[] argv, Locale locale)
Extract the options and non-option arguments from the given
list of command-line arguments. |
Returns: the new Option
Returns: the new Option
Returns: the new Option
Returns: the new Option
Returns: the new Option
Returns: the new Option
Returns: the new Option
Returns: the new Option
Returns: the new Option
Returns: the new Option
getOptionValue(o,
null)
.Returns: the parsed value of the given Option, or null if the option was not set
Returns: A Vector giving the parsed values of all the occurrences of the given Option, or an empty Vector if the option was not set.
Returns: the non-option arguments