|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tentackle.util.CommandLine
public class CommandLine
Command line arguments and options.
Scans an array of argument strings and parses options.
Options start with two dashes, for example --enabled
and can have a value like --timeout=30.
All other strings are considered as standard args.
| Constructor Summary | |
|---|---|
CommandLine()
Creates an empty command line. |
|
CommandLine(String[] args)
Creates a command line from console args. |
|
| Method Summary | |
|---|---|
List<String> |
getArguments()
Gets the list of non-option arguments |
Map<String,String> |
getOptions()
Gets the options. |
Properties |
getOptionsAsProperties()
Gets the options as properties. |
String |
getOptionValue(String option)
Gets the value for an option "--opt=...". |
boolean |
isOptionSet(String option)
Checks if an option has been set or not. |
void |
setArgs(String[] args)
Sets the arguments. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CommandLine(String[] args)
args - the command line args (usually from main-method)public CommandLine()
| Method Detail |
|---|
public void setArgs(String[] args)
args - the arguments (usually from commandline)public boolean isOptionSet(String option)
option - the option name (without the leading --)
public String getOptionValue(String option)
option - the option name
public List<String> getArguments()
public Map<String,String> getOptions()
public Properties getOptionsAsProperties()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||