ArgParser

abstract class ArgParser[T]

Parses argument values of type T.

Type parameters:
T:

parsed value type

Companion:
object
class Object
trait Matchable
class Any

Value members

Abstract methods

def apply(current: Option[T], index: Int, span: Int, value: String): Either[Error, T]
Implicitly added by last

Parses a value.

Parses a value.

value must be consumed. Corresponds to cases like --foo=bar.

Value parameters:
current:

latest parsed value wrapped in scala.Some if any, scala.None else

value:

scala.Predef.String to parse

Returns:

in case of success, a T, wrapped in scala.Right; else, and error message, wrapped in caseapp.core.Error and scala.Left

def apply(current: Option[T], index: Int, span: Int, value: String): Either[Error, T]
Implicitly added by list

Parses a value.

Parses a value.

value must be consumed. Corresponds to cases like --foo=bar.

Value parameters:
current:

latest parsed value wrapped in scala.Some if any, scala.None else

value:

scala.Predef.String to parse

Returns:

in case of success, a T, wrapped in scala.Right; else, and error message, wrapped in caseapp.core.Error and scala.Left

def apply(current: Option[T], index: Int, span: Int, value: String): Either[Error, T]
Implicitly added by option

Parses a value.

Parses a value.

value must be consumed. Corresponds to cases like --foo=bar.

Value parameters:
current:

latest parsed value wrapped in scala.Some if any, scala.None else

value:

scala.Predef.String to parse

Returns:

in case of success, a T, wrapped in scala.Right; else, and error message, wrapped in caseapp.core.Error and scala.Left

def apply(current: Option[T], index: Int, span: Int, value: String): Either[Error, T]
Implicitly added by vector

Parses a value.

Parses a value.

value must be consumed. Corresponds to cases like --foo=bar.

Value parameters:
current:

latest parsed value wrapped in scala.Some if any, scala.None else

value:

scala.Predef.String to parse

Returns:

in case of success, a T, wrapped in scala.Right; else, and error message, wrapped in caseapp.core.Error and scala.Left

def apply(current: Option[T], index: Int, span: Int, value: String): Either[Error, T]

Parses a value.

Parses a value.

value must be consumed. Corresponds to cases like --foo=bar.

Value parameters:
current:

latest parsed value wrapped in scala.Some if any, scala.None else

value:

scala.Predef.String to parse

Returns:

in case of success, a T, wrapped in scala.Right; else, and error message, wrapped in caseapp.core.Error and scala.Left

Implicitly added by last

Value description.

Value description.

Used in help messages.

Implicitly added by list

Value description.

Value description.

Used in help messages.

Implicitly added by option

Value description.

Value description.

Used in help messages.

Implicitly added by vector

Value description.

Value description.

Used in help messages.

Value description.

Value description.

Used in help messages.

Concrete methods

def apply(current: Option[T], index: Int): Either[Error, T]
Implicitly added by last

Called when the corresponding argument was specified with no value.

Called when the corresponding argument was specified with no value.

Can happen if the option was enabled as very last argument, like --bar in --foo 1 other --bar.

Value parameters:
current:

latest parsed value wrapped in scala.Some if any, scala.None else

Returns:

a T wrapped in scala.Right in case of success, or an error message wrapped in caseapp.core.Error and scala.Left else

def apply(current: Option[T], index: Int): Either[Error, T]
Implicitly added by list

Called when the corresponding argument was specified with no value.

Called when the corresponding argument was specified with no value.

Can happen if the option was enabled as very last argument, like --bar in --foo 1 other --bar.

Value parameters:
current:

latest parsed value wrapped in scala.Some if any, scala.None else

Returns:

a T wrapped in scala.Right in case of success, or an error message wrapped in caseapp.core.Error and scala.Left else

def apply(current: Option[T], index: Int): Either[Error, T]
Implicitly added by option

Called when the corresponding argument was specified with no value.

Called when the corresponding argument was specified with no value.

Can happen if the option was enabled as very last argument, like --bar in --foo 1 other --bar.

Value parameters:
current:

latest parsed value wrapped in scala.Some if any, scala.None else

Returns:

a T wrapped in scala.Right in case of success, or an error message wrapped in caseapp.core.Error and scala.Left else

def apply(current: Option[T], index: Int): Either[Error, T]
Implicitly added by vector

Called when the corresponding argument was specified with no value.

Called when the corresponding argument was specified with no value.

Can happen if the option was enabled as very last argument, like --bar in --foo 1 other --bar.

Value parameters:
current:

latest parsed value wrapped in scala.Some if any, scala.None else

Returns:

a T wrapped in scala.Right in case of success, or an error message wrapped in caseapp.core.Error and scala.Left else

def apply(current: Option[T], index: Int): Either[Error, T]

Called when the corresponding argument was specified with no value.

Called when the corresponding argument was specified with no value.

Can happen if the option was enabled as very last argument, like --bar in --foo 1 other --bar.

Value parameters:
current:

latest parsed value wrapped in scala.Some if any, scala.None else

Returns:

a T wrapped in scala.Right in case of success, or an error message wrapped in caseapp.core.Error and scala.Left else

Implicitly added by last

Whether the parsed value corresponds to a flag.

Whether the parsed value corresponds to a flag.

Prevents telling corresponding arguments expect a value in help messages.

Implicitly added by list

Whether the parsed value corresponds to a flag.

Whether the parsed value corresponds to a flag.

Prevents telling corresponding arguments expect a value in help messages.

Implicitly added by option

Whether the parsed value corresponds to a flag.

Whether the parsed value corresponds to a flag.

Prevents telling corresponding arguments expect a value in help messages.

Implicitly added by vector

Whether the parsed value corresponds to a flag.

Whether the parsed value corresponds to a flag.

Prevents telling corresponding arguments expect a value in help messages.

Whether the parsed value corresponds to a flag.

Whether the parsed value corresponds to a flag.

Prevents telling corresponding arguments expect a value in help messages.

def optional(current: Option[T], index: Int, span: Int, value: String): (Consumed, Either[Error, T])
Implicitly added by last

Parses a value.

Parses a value.

Unlike apply above, value may or may not be consumed. Corresponds to cases like --foo bar.

Use of value or not must be returned via the caseapp.core.argparser.Consumed value.

Value parameters:
current:

latest parsed value wrapped in scala.Some if any, scala.None else

value:

scala.Predef.String to parse

Returns:

in case of success, whether value was consumed and a T, wrapped in scala.Right; else, and error message, wrapped in caseapp.core.Error and scala.Left

def optional(current: Option[T], index: Int, span: Int, value: String): (Consumed, Either[Error, T])
Implicitly added by list

Parses a value.

Parses a value.

Unlike apply above, value may or may not be consumed. Corresponds to cases like --foo bar.

Use of value or not must be returned via the caseapp.core.argparser.Consumed value.

Value parameters:
current:

latest parsed value wrapped in scala.Some if any, scala.None else

value:

scala.Predef.String to parse

Returns:

in case of success, whether value was consumed and a T, wrapped in scala.Right; else, and error message, wrapped in caseapp.core.Error and scala.Left

def optional(current: Option[T], index: Int, span: Int, value: String): (Consumed, Either[Error, T])
Implicitly added by option

Parses a value.

Parses a value.

Unlike apply above, value may or may not be consumed. Corresponds to cases like --foo bar.

Use of value or not must be returned via the caseapp.core.argparser.Consumed value.

Value parameters:
current:

latest parsed value wrapped in scala.Some if any, scala.None else

value:

scala.Predef.String to parse

Returns:

in case of success, whether value was consumed and a T, wrapped in scala.Right; else, and error message, wrapped in caseapp.core.Error and scala.Left

def optional(current: Option[T], index: Int, span: Int, value: String): (Consumed, Either[Error, T])
Implicitly added by vector

Parses a value.

Parses a value.

Unlike apply above, value may or may not be consumed. Corresponds to cases like --foo bar.

Use of value or not must be returned via the caseapp.core.argparser.Consumed value.

Value parameters:
current:

latest parsed value wrapped in scala.Some if any, scala.None else

value:

scala.Predef.String to parse

Returns:

in case of success, whether value was consumed and a T, wrapped in scala.Right; else, and error message, wrapped in caseapp.core.Error and scala.Left

def optional(current: Option[T], index: Int, span: Int, value: String): (Consumed, Either[Error, T])

Parses a value.

Parses a value.

Unlike apply above, value may or may not be consumed. Corresponds to cases like --foo bar.

Use of value or not must be returned via the caseapp.core.argparser.Consumed value.

Value parameters:
current:

latest parsed value wrapped in scala.Some if any, scala.None else

value:

scala.Predef.String to parse

Returns:

in case of success, whether value was consumed and a T, wrapped in scala.Right; else, and error message, wrapped in caseapp.core.Error and scala.Left

final def xmap[U](from: U => T, to: T => U): ArgParser[U]
Implicitly added by last
final def xmap[U](from: U => T, to: T => U): ArgParser[U]
Implicitly added by list
final def xmap[U](from: U => T, to: T => U): ArgParser[U]
Implicitly added by option
final def xmap[U](from: U => T, to: T => U): ArgParser[U]
Implicitly added by vector
final def xmap[U](from: U => T, to: T => U): ArgParser[U]
final def xmapError[U](from: U => T, to: T => Either[Error, U]): ArgParser[U]
Implicitly added by last
final def xmapError[U](from: U => T, to: T => Either[Error, U]): ArgParser[U]
Implicitly added by list
final def xmapError[U](from: U => T, to: T => Either[Error, U]): ArgParser[U]
Implicitly added by option
final def xmapError[U](from: U => T, to: T => Either[Error, U]): ArgParser[U]
Implicitly added by vector
final def xmapError[U](from: U => T, to: T => Either[Error, U]): ArgParser[U]