ParamDef

case class ParamDef(names: Seq[String], parseAndSet: (String, Option[String]) => ParamResult, missing: () => Unit, isFlag: Boolean, repeatPositional: Boolean, absorbRemaining: Boolean)

A parameter definition is the low-level building block to define the grammar of a command-line, and its functionality.

ParamDefs associate parameter names to actions that are invoked by Parser.parse() in certain situations.

Value Params
absorbRemaining

Treat all subsequent parameters as positionals, regardless of their name. This can be useful for constructing nested commands.

isFlag

Indicates if this named parameter is a flag, i.e. one that never accepts an argument. In case its name is encountered, its value is set to "true". Has no effect on positional parameters.

missing

A function that is invoked if this parameter has not been encountered at all.

names

All names that may be used by this parameter. If a name starts with -, it is considered a "named" parameter, otherwise it is considered a "positional" parameter. Arguments associated to named parameters may appear in any order on the command line, as long as they are prefixed by the parameter's name. Positional parameters are given arguments in the order they appear in.

parseAndSet

A function that is invoked anytime this parameter is encountered on the command line. In case of a named param, the first element is the actual name used, and the second element is the argument or None if no argument followed. In case of a position param, the parameter's first name is given and the argument value is always defined.

repeatPositional

If this is a positional parameter, it will be the parser will repeat it indefinitely.

trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def isNamed: Boolean

Inherited methods

def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product