Returns the (0-based) index where this element was placed on the command line.
Returns the (0-based) index where this element was placed on the command line. This makes it possible to sort command line items by their position they have been placed on the command line.
the index of this CliElement on the command line
Returns the key used for this parameter value on the command line.
Returns the key used for this parameter value on the command line. While values are stored under the main parameter key, this method allows determining the key the user has specified (which may be an alias).
the key used for this CliElement
Returns the raw value of this CliElement as specified by the user.
Returns the raw value of this CliElement as specified by the user. The value may be transformed during the extraction phase. If transformation fails, it might be useful to have the original value to construct an error message.
the value of this CliElement
(Since version ) see corresponding Javadoc for more information.
A trait describing an item encountered on the command line.
During parameter parsing the single items on the command line need to be classified into options, switches, or input parameters. For this purpose, a classification function is used which returns sub classes of this trait. The parser needs to handle the sub classes differently.
This trait also plays a role for error handling: It stores the original key and the raw value of the represented parameter. This information is useful when generating meaningful error messages.
In addition, the position of the corresponding element on the command line can be queried. This is needed by some use cases that override the values of options with values appearing later on the command line.