public class ParseArgs extends Object
| Constructor and Description |
|---|
ParseArgs() |
| Modifier and Type | Method and Description |
|---|---|
Argument |
argument()
Creates a new Argument to parse the default arguments
|
Argument |
argument(String name)
Creates a new Argument to parse input
Provide a null name if it is a default argument
|
void |
parseArgs(String[] args)
Parses the args array fully
|
void |
parseArgs(String[] args,
int start)
Parses the args array fully from start (inclusive)
|
void |
parseArgs(String[] args,
int start,
int end)
Parses the args array from start (inclusive) to end (exclusive)
|
ValCallback |
unknownArgCallback(ValCallback notFoundArgument)
Sets the callback for when an argument is included but no correspondence was found
|
public Argument argument()
public Argument argument(String name)
name - The name of the argumentpublic ValCallback unknownArgCallback(ValCallback notFoundArgument)
notFoundArgument - The callback called if an unknown argument is foundpublic void parseArgs(String[] args)
args - The args array to parsepublic void parseArgs(String[] args, int start)
args - The args array to parsestart - The first index of args array to parsepublic void parseArgs(String[] args, int start, int end) throws ArrayIndexOutOfBoundsException
args - The args array to parsestart - The first index of args array to parseend - The (last - 1) index of args array to parseArrayIndexOutOfBoundsException - if:
* start < 0 || end > args.lengh
* args ended too soon when trying to parse a value with spacesCopyright © 2016. All rights reserved.