Class/Object

com.concurrentthought.cla

Args

Related Docs: object Args | package cla

Permalink

case class Args(programInvocation: String, leadingComments: String, trailingComments: String, opts: Seq[Opt[_]], defaults: Map[String, Any], values: Map[String, Any], allValues: Map[String, Seq[Any]], remaining: Seq[String], failures: Seq[(String, Any)]) extends Product with Serializable

Contains the options defined, the current values, which are the defaults before parsing and afterwards are the defaults overridden by the actual invocation options, and contains any parsing errors that were found, which is empty before parse is called. In order to properly construct the default values, this constructor is protected. Instead, use the companion Args.apply to construct initial instances correctly. Subsequent calls to Args.parse return new, updated instances.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Args
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Args(programInvocation: String, leadingComments: String, trailingComments: String, opts: Seq[Opt[_]], defaults: Map[String, Any], values: Map[String, Any], allValues: Map[String, Seq[Any]], remaining: Seq[String], failures: Seq[(String, Any)])

    Permalink
    Attributes
    protected

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val allValues: Map[String, Seq[Any]]

    Permalink
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. val defaults: Map[String, Any]

    Permalink
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. val failures: Seq[(String, Any)]

    Permalink
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def get[V](flag: String)(implicit arg0: ClassTag[V]): Option[V]

    Permalink

    Return the value for the option.

    Return the value for the option. This will be either the default specified, if the user did not invoke the option, or the _last_ invocation of the command line option. In other words, if the argument list contains --foo bar1 --foo bar2, then Some("bar2") is returned. Note: Use remaining to get the tokens not associated with a flag.

    See also

    getAll

  12. def getAll[V](flag: String)(implicit arg0: ClassTag[V]): Seq[V]

    Permalink

    Return a Seq with all values specified for the option.

    Return a Seq with all values specified for the option. This supports the case where an option can be repeated on the command line. If the user did not specify the option, then default is mapped to a return value as follows:

    • None => Nil
    • Some(x) => Seq(x)

    If the user specified one or more invocations, then all of the values are returned in Seq. For example, for --foo bar1 --foo bar2, then this method returns Seq("bar1", "bar2"). Note: Use remaining to get the tokens not associated with a flag.

    See also

    get

  13. def getAllOrElse[V](flag: String, orElse: Seq[V])(implicit arg0: ClassTag[V]): Seq[V]

    Permalink

    Like getAll, but an alternative is specified, if no value for exists.

    Like getAll, but an alternative is specified, if no value for exists. Note: Use remaining to get the tokens not associated with a flag.

  14. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  15. def getOrElse[V](flag: String, orElse: V)(implicit arg0: ClassTag[V]): V

    Permalink

    Like get, but an alternative is specified, if no value for the option exists, so the return value is of type V, rather than Option[V].

    Like get, but an alternative is specified, if no value for the option exists, so the return value is of type V, rather than Option[V]. Note: Use remaining to get the tokens not associated with a flag.

  16. def handleErrors(out: PrintStream = Console.err): Boolean

    Permalink

    Were errors found in the argument list? If so, print the error messages, followed by the help message and return true.

    Were errors found in the argument list? If so, print the error messages, followed by the help message and return true. Otherwise, return false. Callers may wish to exit if true is returned.

  17. def handleHelp(out: PrintStream = Console.out): Boolean

    Permalink

    Was the help option invoked? If so, print the help message to the output PrintStream and return true.

    Was the help option invoked? If so, print the help message to the output PrintStream and return true. Otherwise, return false. Callers may wish to exit if true is returned.

  18. def help: String

    Permalink
  19. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  20. val leadingComments: String

    Permalink
  21. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. val opts: Seq[Opt[_]]

    Permalink
  25. val opts2: Seq[Opt[_]]

    Permalink
    Attributes
    protected
  26. def parse(args: Seq[String]): Args

    Permalink

    Parse the user-specified arguments, using parserChain.

    Parse the user-specified arguments, using parserChain. Note that if an unrecognized flag is found, i.e., a string that starts with one or two '-', it is an error. Otherwise, all unrecognized options are added to the resulting values in a Seq[String] with the key, "remaining".

    returns

    Args

  27. lazy val parserChain: Parser[_]

    Permalink
  28. def printAllValues(out: PrintStream = Console.out): Unit

    Permalink

    Print all the current values.

    Print all the current values. Before any parsing is done, the values are the defaults. After parsing, they are the defaults overridden by all the user-supplied options. If an option is specified multiple times, then all values are shown.

    See also

    printValues

  29. def printValues(out: PrintStream = Console.out): Unit

    Permalink

    Print the current values.

    Print the current values. Before any parsing is done, the values are the defaults. After parsing, they are the defaults overridden by any user-supplied options. If an option is specified multiple times, then the _last_ invocation is shown. Note that the "remaining" arguments are the same in this output and in printAllValues.

    See also

    printAllValues

  30. def process(args: Seq[String], out: PrintStream = Console.out, exit: (Int) ⇒ Unit = n => sys.exit(n)): Args

    Permalink

    Convenience method to parse the argument list and handle errors or help requests.

    Convenience method to parse the argument list and handle errors or help requests. If a parsing error occurs or help is requested, an appropriate message is printed to the out argument and the program exits with a call to sys.exit(n) with the integer exit returned by the sister Args#process method. Normally, the default values for the out and exit arguments are only overridden for testing. For more customized handling, {@see #parse}.

    returns

    Args

  31. val programInvocation: String

    Permalink
  32. val remaining: Seq[String]

    Permalink
  33. val remainingOpt: Opt[_]

    Permalink
    Attributes
    protected
  34. val remainingOptName: String

    Permalink
    Attributes
    protected
  35. val requiredOptions: Seq[Opt[_]]

    Permalink
  36. def resolveFailures(keys: Seq[String], failures: Seq[(String, Any)]): Seq[(String, Any)]

    Permalink

    Ignore all parse errors if help was requested

    Ignore all parse errors if help was requested

    Attributes
    protected
  37. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  38. def toString(): String

    Permalink
    Definition Classes
    Args → AnyRef → Any
  39. val trailingComments: String

    Permalink
  40. val unknownOptionMatch: Parser[Any]

    Permalink

    Unknown option that starts with one or two '-' matches!

    Unknown option that starts with one or two '-' matches!

    Attributes
    protected
  41. val unknownOptionRE: Regex

    Permalink
    Attributes
    protected
  42. val values: Map[String, Any]

    Permalink
  43. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped