Attributes
- Companion:
- object
- Graph
- Supertypes
- trait Printerstrait LowPrioPrinterstrait TypesApitrait ParsersApiclass Objecttrait Matchableclass Any
- Known subtypes
Members list
Type members
Classlikes
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
Inherited classlikes
A simple command line argument parser.
A simple command line argument parser.
Usage:
-
Define parameters with param, requiredParam and repeatedParam. Each of these methods gives back a handle to a future argument value.
-
Call
parseOrExit()
with actual arguments. -
If parsing succeeds, the arguments will be available in the handles defined in step 1.
If parsing fails, error descriptions are printed and the program exits with 2.
Example:
val parser = argparse.default.ArgumentParser()
val p1 = parser.param[String]("--this-is-a-named-param", default = "default value")
val p2 = parser.param[Int]("positional-param", default = 2)
parser.parseOrExit(Seq("--this-is-a-named-param=other", 5))
println(p1.value)
println(p2.value)
Attributes
- bashCompletionFlag
Use these flags to print a sourceable bash-completion script. Set to empty to disable.
- description
A short description of this command. Used in help messages.
- helpFlags
Use these flags to print the help message. Set to empty to disable.
- Inherited from:
- ParsersApi
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
Attributes
- Inherited from:
- ParsersApi
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
A typeclass that defines how to convert a string from a single command line argument to a given type.
A typeclass that defines how to convert a string from a single command line argument to a given type.
Attributes
- Inherited from:
- TypesApi
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
- object BooleanReader.typeobject DoubleReader.typeobject DurationReader.typeobject FiniteDurationReader.typeobject FloatReader.typetrait FsPathReader[A]object FilePathReader.typeobject JavaFileReader.typeobject JavaPathReader.typeobject PathReader.typeobject RelPathReader.typeobject SubPathReader.typeobject InputStreamReader.typeobject InstantReader.typeobject LocalDateReader.typeobject LocalDateTimeReader.typeobject LocalTime.typeobject OutputStreamReader.typeobject RangeReader.typeobject ReadableReader.typeobject ZonedDateTimeReader.type
Value members
Concrete methods
Top-level error handler for command line applications using the annotation API.
Top-level error handler for command line applications using the annotation API.
You can override this to change what should be done on errors.
The default implementation prints the exception's message unless the DEBUG environment variable is set, in which case the whole stack trace is printed. Then, it exits with error code 1.
Attributes
Inherited methods
The name of the flag to use for generating standalone bash-completion.
The name of the flag to use for generating standalone bash-completion.
Set this to empty to disable bash-completion entirely.
Note that individual argument parsers may override this.
Attributes
- Inherited from:
- ParsersApi
The name of the flag to use for printing help messages.
The name of the flag to use for printing help messages.
Set this to empty to disable help entirely.
Note that individual argument parsers may override this.
Attributes
- Inherited from:
- ParsersApi
Generate a help message from parameters.
Generate a help message from parameters.
This message will be used by ArgumentParser
s. Overriding this allows you
to customize the help message of all ArgumentParser
s.
Attributes
- Inherited from:
- ParsersApi
Called by parseOrExit in case of error.
Called by parseOrExit in case of error.
Overriding this can be useful in situations where you do not want to exit, for example in tests.
Attributes
- Inherited from:
- ParsersApi
Givens
Inherited givens
Attributes
- Inherited from:
- LowPrioPrinters
Attributes
- Inherited from:
- Printers
Attributes
- Inherited from:
- Printers
Attributes
- Inherited from:
- Printers
Attributes
- Inherited from:
- Printers
Attributes
- Inherited from:
- Printers
Attributes
- Inherited from:
- Printers
Attributes
- Inherited from:
- Printers
Implicits
Inherited implicits
Attributes
- Inherited from:
- TypesApi