Packages

p

cmdr

package cmdr

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. cmdr
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. class ArgParser extends SettingsParser

    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 = cmdr.ArgumentParser("appname", "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())
  2. trait Reader[A] extends AnyRef

    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.

    Annotations
    @implicitNotFound("Don't know how to read a ${A} from a command line argument. Try implementing your own cmdr.Reader[$A].")
  3. trait SettingsParser extends AnyRef

Deprecated Type Members

  1. type ArgumentParser = ArgParser
    Annotations
    @deprecated
    Deprecated

    (Since version 0.3.0) use ArgParser() instead

Value Members

  1. val ArgumentParser: ArgParser.type
  2. val argsv: Array[String]

    Get the system arguments eagerly, this allows using them in a constructor, outside of main().

    Get the system arguments eagerly, this allows using them in a constructor, outside of main().

    This may be somewhat of a hack.

  3. object ArgParser
  4. object BashCompletion
  5. object Parser

    Low-level parsing functionality.

    Low-level parsing functionality. See ArgParser for a user-friendly API.

  6. object Reader

Inherited from AnyRef

Inherited from Any

Ungrouped