Arguments
, use this for new development.@Deprecated
public static class MainCmd.Argument
extends java.lang.Object
Argument[] argList = { new Argument("", " argument without key on first position", setmethod) , new Argument("-arg", ":keyed argument", setmethod) , new Argument("-x", ":the help text", setx) , new Argument("", " argument without key on any position", setx) };
arg
is empty and it is not on the last position, this is a non keyed argument
which is expect on this position in the argument list.
arg
is not empty, it is the key for the argument. Usual it starts with "-"
but that is not necessary for the algorithm of argument detection. It is only a style of guide
to give arguments. After the argument one of the character '=' or ':' are possible to follow.
But that is not necessary too. If that characters follow, the argument key is taken.
Elsewhere the longest key is detected which is matching. It is possible to request:
"key1value" and "key11value", the longest key detection wins.
arg
is empty and it is the last Argument[] which is added with MainCmd.addArgument(Argument[])
respectively it is the last entry in MainCmd.argList
, then any argument which does not start
with the given keys are recognized on any position. In this case the distinction between arguments
should be done at user level. For example it may be usual to write "key value key2 value".
Modifier and Type | Field and Description |
---|---|
(package private) java.lang.String |
arg
Deprecated.
|
(package private) java.lang.String |
help
Deprecated.
|
(package private) MainCmd.SetArgument |
set
Deprecated.
|
Constructor and Description |
---|
Argument(java.lang.String arg,
java.lang.String help,
MainCmd.SetArgument set)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
toString()
Deprecated.
|
final java.lang.String arg
final java.lang.String help
final MainCmd.SetArgument set
public Argument(java.lang.String arg, java.lang.String help, MainCmd.SetArgument set)