p

argparse

package argparse

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

Type Members

  1. type Arg[A] = () => A

    An argument accessor is a function that returns an argument, assuming that parsing was successful.

  2. class ArgumentParser 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 = 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())

  3. trait LowPrioReaders extends AnyRef
  4. 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()
  5. trait SettingsParser extends AnyRef

Deprecated Type Members

  1. type ArgParser = ArgumentParser
    Annotations
    @deprecated
    Deprecated

    (Since version 0.14.0) use ArgumentParser() instead

  2. case class dirs(name: String, system: Boolean = false) extends Product with Serializable

    Common directories for an application of a given name.

    Common directories for an application of a given name.

    The directories here are implemented as a mix of the XDG Base Directory Specification, macOS adaptations and a fallback to classic unix directories for system applications.

    Applications are encouraged to use these directories instead of creating their own hierarchies. They are particularly well-suited for use as parameter defaults, for example:

    val parser = argparse.ArgumentParser() val cache = parser.param[os.Path]( "--cache-dir", default = argparse.dirs("myapp").cache

    name

    the name of the application

    system

    use system-wide paths instead of user-specific ones

    Annotations
    @deprecated
    Deprecated

    (Since version 0.10.3) use userdirs for user-specific directories, and the FHS standard for system dirs

  3. type xdg = userdirs.type
    Annotations
    @deprecated
    Deprecated

    (Since version 0.10.3) use userdirs instead

Value Members

  1. 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.

  2. object ArgumentParser
  3. object BashCompletion

    Interactive bash completion.

    Interactive bash completion. Completion logic is handled by this program.

  4. object Parser

    Low-level parsing functionality.

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

  5. object Reader extends LowPrioReaders
  6. object StandaloneBashCompletion

    Standalone bash completion.

    Standalone bash completion. Completion logic is generated in advance; requires bash-completion package installed.

  7. object term

    Properties of the current terminal.

  8. object userdirs

    Common directories for *user* applications, as specified by the [XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html), with some adaptations made for macOS.

    Common directories for *user* applications, as specified by the [XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html), with some adaptations made for macOS.

    See also

    dirs for conventional directories for an application of a given name, including system services.

Deprecated Value Members

  1. val ArgParser: ArgumentParser.type
    Annotations
    @deprecated
    Deprecated

    (Since version 0.14.0) use ArgumentParser() instead

  2. val xdg: userdirs.type
    Annotations
    @deprecated
    Deprecated

    (Since version 0.10.3) use userdirs instead

  3. object dirs extends Serializable
    Annotations
    @deprecated
    Deprecated

    (Since version 0.10.3) use userdirs for user-specific directories, and the FHS standard for system dirs

Inherited from AnyRef

Inherited from Any

Ungrouped