Arg

works.scala.cmd.Arg
trait Arg[A]

Arg are positional arguments passed to the command, and can be parsed to type A

Attributes

Source:
Arg.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Abstract methods

def parse: PartialFunction[String, A]

A partial function that will take the String value of the passed argument, and convert it to type A.

A partial function that will take the String value of the passed argument, and convert it to type A.

Typical usage might be for parsing String to Int/Float/Custom Domain, e.g. for a Argument[Int], parse = str => str.toInt.

Advanced usage could be used to do more targeted work as well, such as processing the argument directly, versus simply obtaining the value for it to be parsed later, e.g. for a Argument[String], parse = str => str.toUpperCase

Attributes

Returns:

the evaluation of String => A

Source:
Arg.scala

Abstract fields

val description: String

Description of the purpose of this Argument

Description of the purpose of this Argument

Attributes

Source:
Arg.scala
val name: String

Name of the flag, to be printed with help

Name of the flag, to be printed with help

Attributes

Source:
Arg.scala