public static class CommandLine.ParseResult
extends java.lang.Object
CommandLine.parse()
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NO_ARGUMENT
A unique empty String to represent the argument of an option
when no argument was given.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getAllOptions()
Get all arguments for all options.
|
java.lang.String |
getOptionArgument(char option)
Get the (last) argument for the given option, or null if the option was
not present; the result is identical to (in the sense of ==)
NO_ARGUMENT if the option was given without a argument.
|
java.lang.String |
getOptionArgument(java.lang.Character option)
Get the (last) argument for the given option, or null if the option was
not present; the result is identical to (in the sense of ==)
NO_ARGUMENT if the option was given without a argument.
|
java.lang.String |
getOptionArgument(java.lang.String option)
Get the (last) argument for the given option, or null if the option was
not present; the result is identical to (in the sense of ==)
NO_ARGUMENT if the option was given without an argument.
|
java.util.List<java.lang.String> |
getOptionArguments(java.lang.String option)
Get all arguments for the given option, or null if the option was
not present; an argument is identical (in the sense of ==) to
NO_ARGUMENT if the option was given without an argument.
|
java.util.List<java.lang.String> |
getParameters()
Get all command line arguments except options and their arguments.
|
boolean |
hasOption(char option)
Check whether the last parsed command line has the given option.
|
boolean |
hasOption(java.lang.Character option)
Check whether the last parsed command line has the given option.
|
boolean |
hasOption(java.lang.String option)
Check whether the last parsed command line has the given option.
|
public static final java.lang.String NO_ARGUMENT
public java.lang.String getOptionArgument(char option)
option
- the option for which the argument is requestedNO_ARGUMENT
public java.lang.String getOptionArgument(java.lang.Character option)
option
- the option for which the argument is requestedNO_ARGUMENT
public java.lang.String getOptionArgument(java.lang.String option)
option
- the option for which the argument is requestedNO_ARGUMENT
public java.util.List<java.lang.String> getOptionArguments(java.lang.String option)
option
- the option for which the arguments are requestedNO_ARGUMENT
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getAllOptions()
public java.util.List<java.lang.String> getParameters()
public boolean hasOption(char option)
option
- the optionpublic boolean hasOption(java.lang.Character option)
option
- the optionpublic boolean hasOption(java.lang.String option)
option
- the option