RestrictedCommandsParser

scala.cli.commands.RestrictedCommandsParser
See theRestrictedCommandsParser companion object
final case class RestrictedCommandsParser[T](underlying: Parser[T]) extends Parser[T]

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Parser[T]
trait ParserMethods[T]
class Object
trait Matchable
class Any

Members list

Concise view

Type members

Types

type D = 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.

Attributes

Value members

Concrete methods

def args: Seq[Arg]

Arguments this parser accepts.

Arguments this parser accepts.

Used to generate help / usage messages.

Attributes

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.

Attributes

d:

final intermediate value

nameFormatter:

formats names to the appropriate format

Returns:

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

def init: D

Initial value used to accumulate parsed arguments.

Initial value used to accumulate parsed arguments.

Attributes

override def step(args: List[String], index: Int, d: D, nameFormatter: Formatter[Name]): Either[(Error, Arg, List[String]), Option[(D, Arg, 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.

Attributes

args:

arguments to process

d:

current intermediate result

nameFormatter:

formats name to the appropriate format

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.

Definition Classes
ParserMethods
def withDefaultOrigin(origin: String): Parser[T]

Inherited methods

def complete(args: Seq[String], index: Int, completer: Completer[T], stopAtFirstUnrecognized: Boolean, ignoreUnrecognized: Boolean): List[CompletionItem]

Attributes

Inherited from:
ParserMethods

Attributes

Inherited from:
ParserMethods
def defaultNameFormatter: Formatter[Name]

Attributes

Inherited from:
ParserMethods

Attributes

Inherited from:
ParserMethods
final def detailedParse(args: Seq[String], stopAtFirstUnrecognized: Boolean, ignoreUnrecognized: Boolean): Either[Error, (T, RemainingArgs)]

Attributes

Inherited from:
ParserMethods
final def detailedParse(args: Seq[String], stopAtFirstUnrecognized: Boolean): Either[Error, (T, RemainingArgs)]

Attributes

Inherited from:
ParserMethods
final def detailedParse(args: Seq[String]): Either[Error, (T, RemainingArgs)]

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

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

Attributes

Inherited from:
ParserMethods
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.

Attributes

d:

final intermediate value

Returns:

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

Inherited from:
ParserMethods
def ignoreUnrecognized: Parser[T]

Attributes

Inherited from:
Parser
final def map[U](f: T => U): Parser[U]

Attributes

Inherited from:
Parser
def nameFormatter(f: Formatter[Name]): Parser[T]

Attributes

Inherited from:
Parser
final def parse(args: Seq[String]): Either[Error, (T, Seq[String])]

Attributes

Inherited from:
ParserMethods
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
final def scan(args: Seq[String], stopAtFirstUnrecognized: Boolean, ignoreUnrecognized: Boolean): (Either[(Error, Either[D, T]), (T, RemainingArgs)], List[Step])

Attributes

Inherited from:
ParserMethods
def step(args: List[String], index: Int, d: D): Either[(Error, Arg, List[String]), Option[(D, Arg, List[String])]]

Attributes

Inherited from:
ParserMethods

Attributes

Inherited from:
Parser
final def withFullHelp: Parser[WithFullHelp[T]]

Attributes

Inherited from:
Parser
final def withHelp: Parser[WithHelp[T]]

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

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

Attributes

Inherited from:
Parser