Parser

de.halcony.argparse.Parser
case class Parser(name: String, description: String) extends ParsedArgument[AnyVal]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class ParsedArgument[AnyVal]
class BaseArgument
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def addDefault[T](name: String, value: T): Parser

Add a default argument to the current parser

Add a default argument to the current parser

the deepest used parser's default argument will take precedent

Type parameters

T

the type of the value of the default argument

Value parameters

name

the name of the default argument

value

the value the default argument is supposed to take

Attributes

Returns

the parser itself to chain commands

def addFlag(name: String, short: Char, long: String, description: String): Parser

add a flag

add a flag

Value parameters

description

the description of what the flag affects

long

the long name of the flag

name

the name of the flag

short

the short name of the flag

Attributes

Returns

the parser itself to chain commands

def addOptional[T](name: String, short: Char, long: String, process: String => T, default: Option[T], description: String)(implicit tag: ClassTag[T]): Parser

add an optional argument

add an optional argument

Type parameters

T

the type of the final value of the argument

Value parameters

default

the default value if no argument is provided by the user

description

the description for the optional argument

long

the long name for the optional argument

name

the name of the optional argument

process

the function to process the cmd line string to the argument type

short

the short name for the optional argument

Attributes

Returns

the parser itself to chain commands

def addPositional[T](name: String, process: String => T)(implicit tag: ClassTag[T]): Parser

add a positional argument

add a positional argument

Value parameters

name

the name of the positional argument

Attributes

Returns

the parser itself to chain commands

def addPositional[T](name: String, process: String => T, description: String)(implicit tag: ClassTag[T]): Parser

add a positional argument

add a positional argument

Type parameters

T

the type of the finally parsed positional argument after parsing

Value parameters

description

the description of the argument

name

the name of the positional argument

process

the function to process the cmd line string to the argument type

Attributes

Returns

the parser itself to chain commands

def addSubparser(parser: Parser): Parser
def createCommandString(current: Option[String]): String
override def help(): String

Attributes

Definition Classes
override def parse(args: Iterable[String])(implicit result: ParsingResult): Iterable[String]

Attributes

Definition Classes
def parseArgs(args: Iterable[String])(implicit parsingResult: ParsingResult): ParsingResult
def setParent(parent: Parser): Parser

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product