default

object default extends Api
trait Api
trait TypesApi
class Object
trait Matchable
class Any

Type members

Inherited classlikes

class ArgumentParser(val description: String, val enableHelpFlag: Boolean, val enableBashCompletionFlag: Boolean, val stdout: PrintStream, val stderr: PrintStream, val env: Map[String, String])

A simple command line argument parser.

A simple command line argument parser.

Usage:

  1. Define parameters with param, requiredParam, repeatedParam and command. Each of these methods gives back a handle to a future argument value.

  2. Call parse() with actual arguments.

  3. 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. (This behaviour may be changed by subclassing and redefining the check() method).

Example

val parser = argparse.ArgumentParser("0.1.0")

val p1 = parser.param[String]("--this-is-a-named-param", default = "default value")
val p2 = parser.param[Int]("positional-param", default = 2)

parser.parse(Seq("--this-is-a-named-param=other", 5)) println(p1())

println(p2())
Value Params
description

a short description of this command. Used in help messages.

enableHelpFlag

include a --help flag which will print a generated help message

Inherited from
ParsersApi
Inherited from
ParsersApi
Inherited from
ReadersApi
object DoubleReader
Inherited from
ReadersApi
Inherited from
ReadersApi
Inherited from
ReadersApi
Inherited from
ReadersApi
object FloatReader
Inherited from
ReadersApi
trait FsPathReader[A]
Inherited from
ReadersApi
Inherited from
ReadersApi
Inherited from
ReadersApi
Inherited from
ReadersApi
Inherited from
ReadersApi
Inherited from
ReadersApi
Inherited from
ReadersApi
object LocalTime
Inherited from
ReadersApi
Inherited from
ReadersApi
object PathReader
Inherited from
ReadersApi
object RangeReader
Inherited from
ReadersApi
Inherited from
ReadersApi
object Reader
Inherited from
TypesApi
@implicitNotFound("No argparse.Reader[${A}] found. A reader is required to parse a command line argument from a string to a ${A}. ".+("Please define an argparse.Reader[${A}]."))
trait Reader[A]

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.

Inherited from
TypesApi
Inherited from
ReadersApi
Inherited from
ReadersApi
Inherited from
ReadersApi

Value members

Inherited methods

def bashCompletionFlag: String

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 the empty string to disable bash-completion entirely.

Inherited from
ParsersApi
def help(description: String, params: Seq[ParamInfo], commands: Seq[CommandInfo]): String

Generate a help message from parameters.

Generate a help message from parameters.

This message will be used by ArgumentParsers. Overriding this allows you to customize the help message of all ArgumentParsers.

Inherited from
ParsersApi
Inherited from
MainArgsApi

Inherited fields

val pathCompleter: String => Seq[String]
Inherited from
ReadersApi

Implicits

Inherited implicits

implicit def CollectionReader[Elem, Col <: ([Elem] =>> Iterable[Elem])](implicit elementReader: Reader[Elem], factory: Factory[Elem, Col[Elem]]): Reader[Col[Elem]]
Inherited from
LowPrioReaders
implicit def FilePathCollectionReader[Col <: Iterable[FilePath]](implicit factory: Factory[FilePath, Col]): Reader[Col]
Inherited from
ReadersApi
implicit def IntegralReader[N](implicit numeric: Integral[N]): Reader[N]
Inherited from
ReadersApi
implicit def JFileCollectionReader[Col <: Iterable[File]](implicit factory: Factory[File, Col]): Reader[Col]
Inherited from
ReadersApi
implicit def JPathCollectionReader[Col <: Iterable[Path]](implicit factory: Factory[Path, Col]): Reader[Col]
Inherited from
ReadersApi
implicit def Mapping[K, V](implicit kr: Reader[K], vr: Reader[V]): Reader[(K, V)]
Inherited from
ReadersApi
implicit def OptionReader[A](implicit elementReader: Reader[A]): Reader[Option[A]]
Inherited from
ReadersApi
implicit def PathCollectionReader[Col <: Iterable[Path]](implicit factory: Factory[Path, Col]): Reader[Col]
Inherited from
ReadersApi
implicit def RelPathCollectionReader[Col <: Iterable[RelPath]](implicit factory: Factory[RelPath, Col]): Reader[Col]
Inherited from
ReadersApi
implicit val StringReader: Reader[String]
Inherited from
TypesApi
implicit def SubPathCollectionReader[Col <: Iterable[SubPath]](implicit factory: Factory[SubPath, Col]): Reader[Col]
Inherited from
ReadersApi