public class ArgParser
extends java.lang.Object
| Constructor and Description |
|---|
ArgParser(java.lang.String[] args)
Instantiates a new ArgParser object and parses the provided arguments.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String[] |
arguments()
Returns all normal (non-flag/option arguments).
|
boolean |
flag(char flag)
Returns whether the specified flag exists.
|
java.lang.Character[] |
flags()
Returns all flag arguments.
|
boolean |
hasValue(java.lang.String option)
Returns whether the specified option has a value.
|
boolean |
option(java.lang.String name)
Returns whether the specified option exists.
|
char |
optionChar(java.lang.String option)
Returns the value of the specified option as a char.
|
double |
optionDouble(java.lang.String option)
Returns the value of the specified option as a double.
|
int |
optionInt(java.lang.String option)
Returns the value of the specified option as an int.
|
java.util.HashMap<java.lang.String,java.lang.String> |
options()
Returns all options as a HashMap.
|
java.lang.String |
optionString(java.lang.String option)
Returns the value of the specified option as a String.
|
public ArgParser(java.lang.String[] args)
args - the command line arguments to parsepublic java.lang.String[] arguments()
public java.lang.Character[] flags()
public java.util.HashMap<java.lang.String,java.lang.String> options()
public boolean option(java.lang.String name)
name - the name of the optionpublic boolean flag(char flag)
flag - the flag charpublic java.lang.String optionString(java.lang.String option)
option - the name of the optionpublic int optionInt(java.lang.String option)
option - the name of the optionpublic char optionChar(java.lang.String option)
option - the name of the optionpublic double optionDouble(java.lang.String option)
option - the name of the optionpublic boolean hasValue(java.lang.String option)
option - the name of the option