SingleParam

clam.derivation.DerivationApi.SingleParam
case class SingleParam[A](scalaName: String, default: Option[() => A], annot: param, doc: String, argName0: Option[String], reader0: Reader[A], completer: Completer[A]) extends Parser[A]

A single CLI parameter (may not be repeated) which maps to a single scala parameter.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[A]
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

def extract(args: Result, ctx: ParseCtx): Result[A]

Inherited methods

def acceptsUnknown: Boolean

Set this to true if the extraction will handle an unknown getopt result and its remainder.

Set this to true if the extraction will handle an unknown getopt result and its remainder.

Attributes

Inherited from:
Parser
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def subcommands: Map[String, Command[_]]

Override this to define subcommands.

Override this to define subcommands.

Notes:

  • There can only be one parser which defines subcommands, and this parser must come last. More than one will lead to an impossible CLI grammar.
  • The reason for defining subcommands in the Parser trait (instead of subclassing it), is so that parsers can easily be composed and reused.

Attributes

Inherited from:
Parser

Concrete fields

val argName: Option[String]
val name: String
val paramDefs: Vector[ParamDef]
val reader: Reader[A]