Returns the optional long name.
Returns the optional long name.
a Some
containing the long name or None
if not specified
Returns the optional short name.
Returns the optional short name.
a Some
containing the short name or None
if not specified
Binds a processor to this option name in replacing mode.
Binds a processor to this option name in replacing mode.
During argument parsing, the value returned by this processor replaces any value previously assigned to this option.
Example
val opt = ("timeout", 't') ~> as[Int]
the return type of the processor
an option processor
Binds a processor to this option name in appending mode.
Binds a processor to this option name in appending mode.
During argument parsing, the value returned by this processor is appended to a sequence of values previously assigned to this option.
Example
val opt = ("server", 's') ~>+ as[String]
the return type of the processor
an option processor
An option name containing both long and short forms.
Option names can be expressed in one of three forms, all of which are represented by this type:
An instance of this class is typically constructed using the DSL in which several implicit methods convert various combinations of types to OptName when the ~> and ~>+ methods are used to bind a processor.
The following types are implicitly converted:
(String, Char)
-- represents both long and short formsString
-- represents long form onlyChar
-- represents short form onlyExamples
Constraints
The construction of both long and short names is constrained to a subset of printable characters found in the
US-ASCII
character set. A violation of these constraints will causeIllegalArgumentException
to be thrown by the constructor.A long name must adhere to the following regular expression:
A short name must adhere to the following regular expression:
[a-zA-Z0-9?]