Packages

abstract class Parser[T] extends AnyRef

Parses arguments, resulting in a T in case of success.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Parser
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Parser()

Type Members

  1. abstract type D

    Intermediate result type.

    Intermediate result type.

    Used during parsing, while checking the arguments one after the other.

    If parsing succeeds, a T can be built from the D at the end of parsing.

Abstract Value Members

  1. abstract def args: Seq[Arg]

    Arguments this parser accepts.

    Arguments this parser accepts.

    Used to generate help / usage messages.

  2. abstract def get(d: D, nameFormatter: Formatter[Name]): Either[Error, T]

    Get the final result from the final intermediate value.

    Get the final result from the final intermediate value.

    Typically fails if some mandatory arguments were not specified, so are missing in d, preventing building a T out of it.

    returns

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

  3. abstract def init: D

    Initial value used to accumulate parsed arguments.

  4. abstract def step(args: List[String], d: D, nameFormatter: Formatter[Name]): Either[(Error, List[String]), Option[(D, List[String])]]

    Process the next argument.

    Process the next argument.

    If some arguments were successfully processed (third case in return below), the returned remaining argument sequence must be shorter than the passed args.

    This method doesn't fully process args. It tries just to parse *one* argument (typically one option --foo and its value bar, so two elements from args - it can also be only one element in case of a flag), if possible. If you want to fully process a sequence of arguments, see parse or detailedParse.

    returns

    if no argument were parsed, Right(None); if an error occurred, an error message wrapped in caseapp.core.Error and scala.Left; else the next intermediate value and the remaining arguments wrapped in scala.Some and scala.Right.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. def defaultNameFormatter: Formatter[Name]
  7. def defaultStopAtFirstUnrecognized: Boolean
  8. final def detailedParse(args: Seq[String], stopAtFirstUnrecognized: Boolean): Either[Error, (T, RemainingArgs)]
  9. final def detailedParse(args: Seq[String]): Either[Error, (T, RemainingArgs)]

    Keeps the remaining args before and after a possible -- separated

  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def get(d: D): Either[Error, T]

    Get the final result from the final intermediate value.

    Get the final result from the final intermediate value.

    Typically fails if some mandatory arguments were not specified, so are missing in d, preventing building a T out of it.

    returns

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

  14. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. final def map[U](f: (T) ⇒ U): Aux[U, D]
  18. def nameFormatter(f: Formatter[Name]): Parser[T]
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. final def parse(args: Seq[String]): Either[Error, (T, Seq[String])]
  23. final def step(args: List[String], d: D): Either[(Error, List[String]), Option[(D, List[String])]]

    Process the next argument.

    Process the next argument.

    If some arguments were successfully processed (third case in return below), the returned remaining argument sequence must be shorter than the passed args.

    This method doesn't fully process args. It tries just to parse *one* argument (typically one option --foo and its value bar, so two elements from args - it can also be only one element in case of a flag), if possible. If you want to fully process a sequence of arguments, see parse or detailedParse.

    returns

    if no argument were parsed, Right(None); if an error occurred, an error message wrapped in caseapp.core.Error and scala.Left; else the next intermediate value and the remaining arguments wrapped in scala.Some and scala.Right.

  24. def stopAtFirstUnrecognized: Parser[T]
  25. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  26. def toString(): String
    Definition Classes
    AnyRef → Any
  27. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  30. final def withHelp: Parser[WithHelp[T]]

    Creates a Parser accepting help / usage arguments, out of this one.

Inherited from AnyRef

Inherited from Any

Ungrouped