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.
Arguments this parser accepts.
Arguments this parser accepts.
Used to generate help / usage messages.
Keeps the remaining args before and after a possible -- separated
Keeps the remaining args before and after a possible -- separated
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.
in case of success, a T
wrapped in scala.Right; else, an error message, wrapped in caseapp.core.Error and scala.Left
Initial value used to accumulate parsed arguments.
Initial value used to accumulate parsed arguments.
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
.
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.
Creates a Parser accepting help / usage arguments, out of this one.