trait OptName extends AnyRef
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:
- long only
- short only
- both long and short
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 only
Examples
("help", '?') "help" '?'
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 cause IllegalArgumentException
to be thrown by the
constructor.
A long name must adhere to the following regular expression:
[a-zA-Z0-9][a-zA-Z0-9-]+
A short name must adhere to the following regular expression:
[a-zA-Z0-9?]
- Alphabetic
- By Inheritance
- OptName
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
lname: Option[String]
Returns the optional long name.
Returns the optional long name.
- returns
a
Some
containing the long name orNone
if not specified
-
abstract
def
sname: Option[Char]
Returns the optional short name.
Returns the optional short name.
- returns
a
Some
containing the short name orNone
if not specified
-
abstract
def
~>[A](fn: OptProcessor[A]): Opt[A]
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]
- A
the return type of the processor
- fn
an option processor
-
abstract
def
~>+[A](fn: OptProcessor[A]): Opt[A]
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]
- A
the return type of the processor
- fn
an option processor
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )