SingleValueConverter

dfhdl.app.SingleValueConverter
trait SingleValueConverter[T] extends ValueConverter[T]

Attributes

Graph
Supertypes
trait ValueConverter[T]
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def parse(arg: String): Either[String, Option[T]]

Concrete methods

final def parse(args: List[(String, List[String])]): Either[String, Option[T]]

Takes a list of arguments to all option invocations: for example, "-a 1 2 -a 3 4 5" would produce List(("a",List(1,2)),("a",List(3,4,5))).

Takes a list of arguments to all option invocations: for example, "-a 1 2 -a 3 4 5" would produce List(("a",List(1,2)),("a",List(3,4,5))).

  • parse returns Left, if there was an error while parsing.

  • if no option was found, it returns Right(None).

  • if option was found, it returns Right(...).

Attributes

Inherited methods

def argFormat(name: String): String

Transformation of argument name to argument definition in help.

Transformation of argument name to argument definition in help.

Attributes

Inherited from:
ValueConverter
def flatMap[B](fn: T => Either[String, Option[B]]): ValueConverter[B]

Map the converter to another value. This method is different from .map because it can return an error (without resorting to exceptions, returning Left(msg)) or can filter out unsupported values (by returning Right(None)).

Map the converter to another value. This method is different from .map because it can return an error (without resorting to exceptions, returning Left(msg)) or can filter out unsupported values (by returning Right(None)).

Attributes

Inherited from:
ValueConverter
def map[B](fn: T => B): ValueConverter[B]

Maps the converter to another value:

Maps the converter to another value:

intConverter.map(_+2) // and you get a "biased converter"

Attributes

Inherited from:
ValueConverter
def parseCached(s: List[(String, List[String])]): Either[String, Option[T]]

Attributes

Inherited from:
ValueConverter

Concrete fields

final val argType: SINGLE.type

Type of parsed argument list.

Type of parsed argument list.

Attributes