Parser

harness.cli.Parser$
See theParser companion trait
object Parser

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Parser.type

Members list

Type members

Classlikes

final case class BuildResult[+T](usedParams: Set[Name], helpMessage: HelpMessage, helpExtraMessage: HelpMessage, parse: IndexedArgs => ParseResult[T])

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ParseResult

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait ParseResult[+T]

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Fail
class Success[T]
object toggle

Parses a boolean based on prefix of baseName:

Parses a boolean based on prefix of baseName:

  • --[dont-]run : --dont-run [false] / --run [true]
  • --[do/dont]-run : --do-run [true] / --dont-run [false]

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
toggle.type
object value

Parses a value from a param:

Parses a value from a param:

  • --base-name VALUE
  • --base-name=VALUE

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
value.type
object values

Parses many values from a param:

Parses many values from a param:

  • --base-name VALUE --base-name VALUE
  • --base-name=VALUE

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
values.type

Value members

Concrete methods

def const[T](value: => T): Parser[T]
def firstOf[T](parser0: Parser[T], parser1: Parser[T], parserN: Parser[T]*): Parser[T]
def flag(baseName: LongName, ifPresent: => Boolean, shortParam: Optional[ShortName], helpHint: List[String], helpExtraHint: List[String]): Parser[Boolean]

Parses a boolean based on whether baseName is provided:

Parses a boolean based on whether baseName is provided:

  • --base-name [ifPresent] / no param [!ifPresent]

Attributes

def helpMessage(left: List[String], right: List[String], rightExtra: List[String]): Parser[Unit]
def helpMessageSection[T](section: String, breakBefore: Boolean)(child: Parser[T]): Parser[T]
def present[T](baseName: LongName, ifPresent: => T, shortParam: Optional[ShortName], helpHint: List[String], helpExtraHint: List[String]): Parser[T]

If present, returns ifPresent, otherwise, fails.

If present, returns ifPresent, otherwise, fails.

Attributes

def rawValue[T](baseName: LongName, helpHint: List[String], helpExtraHint: List[String])(implicit decoder: StringDecoder[T]): Parser[T]

Parses a single normal value, without a param.
Note that this should be used AFTER all param-based calls, because otherwise, something like:
--key KEY-VALUE VALUE
would pull out the KEY-VALUE, and then parse --key VALUE

Parses a single normal value, without a param.
Note that this should be used AFTER all param-based calls, because otherwise, something like:
--key KEY-VALUE VALUE
would pull out the KEY-VALUE, and then parse --key VALUE

Attributes

def rawValues[T](baseName: LongName, helpHint: List[String], helpExtraHint: List[String])(implicit decoder: StringDecoder[T]): Parser[List[T]]

Parses all normal values, without a param.
Note that this should be used AFTER all param-based calls, because otherwise, something like:
--key KEY-VALUE VALUE
would pull out the KEY-VALUE and VALUE, and then parse --key

Parses all normal values, without a param.
Note that this should be used AFTER all param-based calls, because otherwise, something like:
--key KEY-VALUE VALUE
would pull out the KEY-VALUE and VALUE, and then parse --key

Attributes

Concrete fields

val help: Parser[Boolean]

true : help-extra false : help

true : help-extra false : help

Attributes

val unit: Parser[Unit]