Named arguments
Named arguments (they are also called as flags or options) have one or more names. Each name can be short, long or both. They can be declared using NamedArgument
UDA which has the following parameters (see reference for details):
Name | Type | Optional/ Required | Description |
---|---|---|---|
|
| optional | Name(s) of this argument. |
|
| required | Short name(s) of this argument. |
|
| required | Long name(s) of this argument. |
Example:
Short names
Short names in command line are those that start with short name prefix which is a single dash
-
by default (seeConfig.shortNamePrefix
for customization).
If short names are not explicitly passed to NamedArgument
UDA then all single-character names are considered short names (see reference for details).
The following usages of the argument short name in the command line are equivalent:
-name John
-name=John
-n John
-n=John
Additionally, for single-character short names the following is supported:
Omitting of assign character:
-nJohn
is an equivalent to-n=John
.Arguments bundling:
-ab
is and equivalent to-a -b
.
Long names
Long names in command line are those that start with long name prefix which is double dash --
by default (see Config.longNamePrefix
for customization).
If long names are not explicitly passed to NamedArgument
UDA then all multi-character names are considered long names (see reference for details).
The following usages of the argument long names in the command line are equivalent:
--name John
--name=John
--n John
--n=John