public OptionParser
A parser for interface Option
s.
All functions should be pure, since the same command instance can parse arguments multiple times.
interface Option
Modifier and Type | Interface and Description |
---|---|
static class |
OptionParser.Invocation
The input from a single instance of an option input.
|
static class |
OptionParser.ParseResult |
Modifier and Type | Method and Description |
---|---|
OptionParser.ParseResult |
parseLongOpt(Option option,
java.lang.String name,
java.util.List<java.lang.String> argv,
int index,
java.lang.String explicitValue)
Parse a single long option and its value.
|
OptionParser.ParseResult |
parseShortOpt(Option option,
java.lang.String name,
java.util.List<java.lang.String> argv,
int index,
int optionIndex)
Parse a single short option and its value.
|
OptionParser.ParseResult parseShortOpt(Option option, java.lang.String name, java.util.List<java.lang.String> argv, int index, int optionIndex)
Parse a single short option and its value.
name
- The name of the flag used to invoke this optionargv
- The entire list of command line arguments for the commandindex
- The index of the option flag in argv, which may contain multiple short parameters.optionIndex
- The index of the option within argv\[index]
OptionParser.ParseResult parseLongOpt(Option option, java.lang.String name, java.util.List<java.lang.String> argv, int index, java.lang.String explicitValue)
Parse a single long option and its value.
name
- The name of the flag used to invoke this optionargv
- The entire list of command line arguments for the commandindex
- The index of the option flag in argv, which may contain an '=' with the first value