public static class SimpleCLIParser.OptionDefinition extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SimpleCLIParser.OptionDefinition.Type |
Constructor and Description |
---|
OptionDefinition(Object key,
String enableVal,
int numParams,
String description)
Constructor for an option that takes zero or more parameters.
|
OptionDefinition(Object key,
String enableVal,
String disableVal,
boolean enableByDefault,
String description)
Constructor for an option that has separate "enable" and "disable"
strings.
|
Modifier and Type | Method and Description |
---|---|
String |
getDescription() |
String |
getDisableVal() |
String |
getEnableVal() |
Object |
getKey() |
int |
getNumParams() |
SimpleCLIParser.OptionDefinition.Type |
getType() |
boolean |
isEnableByDefault() |
public OptionDefinition(Object key, String enableVal, String disableVal, boolean enableByDefault, String description)
key
- A key used to retrieve this option's value
from the parsed command line. For readability,
an enum
value is the best choice.enableVal
- The command-line string that enables the option.
May be null/blank, if the option is enabled by
default.disableVal
- The command-line string that disables the option.
May be null/blank, if the option is disabled by
default.enableByDefault
- If true
, the option will be enabled
unless explicitly disabled; if false
,
disabled unless specifically enabled.description
- A description of the option.public OptionDefinition(Object key, String enableVal, int numParams, String description)
Parameters may be specified in one of two ways: either as subsequent
arguments on the command line, or in the form :OPTION=PARAM1,...
".
At present, there is no support for an option that has a name that
includes an "=".
key
- A key used to retrieve this option's value
from the parsed command line. For readability,
an enum
value is the best choice.enableVal
- The command-line string that enables the option.numParams
- The number of parameters that this option takes.
This number of non-option command-line arguments
will be shifted from the argument list.description
- A description of the option.public SimpleCLIParser.OptionDefinition.Type getType()
public Object getKey()
public String getEnableVal()
public String getDisableVal()
public boolean isEnableByDefault()
public int getNumParams()
public String getDescription()