CmdLineParser behaviours.
CmdLineParser#CmdLineParser(Object, ParserProperties)
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| pack-priv static final Comparator | |
| private static final int | |
| private Comparator | |
| private String | |
| private boolean | |
| private int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static ParserProperties | |
| public boolean | |
| pack-priv Comparator | Returns: null if options are left unsorted and should be listed by their discovery order.
Otherwise the returned comparator is used to sort options.
The default value is a comparator that sorts options alphabetically.
|
| public String | |
| public boolean | |
| pack-priv int | |
| public ParserProperties | withAtSyntax(boolean
true if at sign is being parsed, false
if it is to be ignored. Defaults to true.Toggles the parsing of @-prefixes in values. |
| public ParserProperties | withOptionSorter(Comparator<OptionHandler<T>>
If non- sorter)null, options are sorted in the order induced by this comparator.Controls how options are sorted in the usage screen. |
| public ParserProperties | withOptionValueDelimiter(String v)
Sets the string used to separate option name and its value (such as --foo=bar vs --foo bar) Default to whitespace. |
| public ParserProperties | withShowDefaults(boolean
true if to show defaults, false
otherweise. Defaults to true.Toggles the showing of default values in the command line help. |
| public ParserProperties | withUsageWidth(int
the width of the usage output in columns. usageWidth)Sets the width of a usage line. |
| atSyntax | back to summary |
|---|---|
| private boolean atSyntax | |
| DEFAULT_COMPARATOR | back to summary |
|---|---|
| pack-priv static final Comparator<OptionHandler<T>> DEFAULT_COMPARATOR | |
| DEFAULT_USAGE_WIDTH | back to summary |
|---|---|
| private static final int DEFAULT_USAGE_WIDTH | |
| optionSorter | back to summary |
|---|---|
| private Comparator<OptionHandler<T>> optionSorter | |
| optionValueDelimiter | back to summary |
|---|---|
| private String optionValueDelimiter | |
| showDefaults | back to summary |
|---|---|
| private boolean showDefaults | |
| usageWidth | back to summary |
|---|---|
| private int usageWidth | |
| ParserProperties | back to summary |
|---|---|
| private ParserProperties() | |
| defaults | back to summary |
|---|---|
| public static ParserProperties defaults() Returns an instance of the default parser properties.
This instance can be manipulated with the | |
| getAtSyntax | back to summary |
|---|---|
| public boolean getAtSyntax() Gets whether @-prefix-parsing is enabled.
| |
| getOptionSorter | back to summary |
|---|---|
pack-priv Comparator
| |
| getOptionValueDelimiter | back to summary |
|---|---|
| public String getOptionValueDelimiter() | |
| getShowDefaults | back to summary |
|---|---|
| public boolean getShowDefaults() Gets whether show defaults is enabled.
| |
| getUsageWidth | back to summary |
|---|---|
pack-priv int getUsageWidth()
| |
| withAtSyntax | back to summary |
|---|---|
| public ParserProperties withAtSyntax(boolean atSyntax) Toggles the parsing of @-prefixes in values. If a command line value starts with @, it is interpreted as being a file, loaded, and interpreted as if the file content would have been passed to the command line.
| |
| withOptionSorter | back to summary |
|---|---|
| public ParserProperties withOptionSorter(Comparator<OptionHandler<T>> sorter) Controls how options are sorted in the usage screen.
| |
| withOptionValueDelimiter | back to summary |
|---|---|
| public ParserProperties withOptionValueDelimiter(String v) Sets the string used to separate option name and its value (such as --foo=bar vs --foo bar) Default to whitespace. Note that the tokens separated in the argument array (such as '-foo','bar') is always recognized as a valid name/value separator. | |
| withShowDefaults | back to summary |
|---|---|
| public ParserProperties withShowDefaults(boolean showDefaults) Toggles the showing of default values in the command line help.
| |
| withUsageWidth | back to summary |
|---|---|
| public ParserProperties withUsageWidth(int usageWidth) Sets the width of a usage line.
If the usage message is longer than this value, the parser wraps the line.
Defaults to
| |