the parent parser instance that owns the option
list of names (short or long) that toggle the value on
list of names (short or long) that toggle the value off
textual description of the option
a function that takes a boolean value and maps it to the appropriate value to store as the option's value.
Called when the option to unset (i.
Called when the option to unset (i.e., when one of the "off" names is
seen on the command line). Subclasses may override this method.
The default version calls convert()
with a false
and stores the
result in value
.
a function that takes a boolean value and maps it to the appropriate value to store as the option's value.
textual description of the option
textual description of the option
The standard equals()
method.
The standard equals()
method.
some other object
true
if the other object is the same class and is equivalent,
false
if not.
Whether or not the argument has an associated value.
Whether or not the argument has an associated value. For instance, parameters have values, and non-flag options have values. Flag options, however, do not.
Calculate the hash code for the object.
Calculate the hash code for the object. The default implementation returns the hash code of the key.
the hash code
#key
Return an object that represents the key for this parameter, suitable for hashing, sorting, etc.
Return an object that represents the key for this parameter, suitable
for hashing, sorting, etc. They key for a command line option is the
result of calling name()
.
the key
Displayable name for the argument, used in the usage message.
Displayable name for the argument, used in the usage message.
the name
List of option names, both long (multi-character) and short (single-character).
List of option names, both long (multi-character) and short (single-character).
the parent parser instance that owns the option
the parent parser instance that owns the option
Resets the internal state of the argument to what it was right after construction, undoing the effects of any parse operation.
Resets the internal state of the argument to what it was right after construction, undoing the effects of any parse operation.
Called when the option is set (i.
Called when the option is set (i.e., when one of the "on" names is
seen on the command line). Subclasses may override this method.
The default version calls convert()
with a true
, and stores the
result in value
.
Set the value, based on whether the specified option name is an "on" or an "off" name.
Set the value, based on whether the specified option name is an "on" or an "off" name.
the name, without any leading "-" or "--"
Get a printable name for this object.
Get a printable name for this object.
the printable name
Class for a flag. A flag option consists of a set of names that enable the flag (e.g. set it to true) if present on the command line, and a set of names that disable the flag (e.g., set it to false) if present on the command line. The type of flag option can be anything, but is generally boolean.