jargs.gnu
Class CmdLineParser
public class CmdLineParser
extends java.lang.Object
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 '--'.
addBooleanOption
public final CmdLineParser.Option addBooleanOption(String longForm)
Convenience method for adding a boolean option.
addBooleanOption
public final CmdLineParser.Option addBooleanOption(char shortForm,
String longForm)
Convenience method for adding a boolean option.
addDoubleOption
public final CmdLineParser.Option addDoubleOption(String longForm)
Convenience method for adding a double option.
addDoubleOption
public final CmdLineParser.Option addDoubleOption(char shortForm,
String longForm)
Convenience method for adding a double option.
addIntegerOption
public final CmdLineParser.Option addIntegerOption(String longForm)
Convenience method for adding an integer option.
addIntegerOption
public final CmdLineParser.Option addIntegerOption(char shortForm,
String longForm)
Convenience method for adding an integer option.
addLongOption
public final CmdLineParser.Option addLongOption(String longForm)
Convenience method for adding a long integer option.
addLongOption
public final CmdLineParser.Option addLongOption(char shortForm,
String longForm)
Convenience method for adding a long integer option.
addStringOption
public final CmdLineParser.Option addStringOption(String longForm)
Convenience method for adding a string option.
addStringOption
public final CmdLineParser.Option addStringOption(char shortForm,
String longForm)
Convenience method for adding a string option.
getOptionValue
public final Object getOptionValue(CmdLineParser.Option o,
Object def)
- the parsed value of the given Option, or null if the
option was not set
getOptionValues
public final Vector getOptionValues(CmdLineParser.Option option)
- A Vector giving the parsed values of all the occurrences of the
given Option, or an empty Vector if the option was not set.
getRemainingArgs
public final String[] getRemainingArgs()
Copyright © 2001-2003 Steve Purcell. Copyright © 2002 Vidar Holen. Copyright © 2002 Michal Ceresna. Copyright © 2005 Ewan Mellor. Released under the terms of the BSD licence.