org.rogach.scallop

Scallop

case class Scallop(args: Seq[String], opts: List[CliOption], vers: Option[String], bann: Option[String], foot: Option[String], optionSetValidations: List[(List[String]) ⇒ Either[String, Unit]], helpWidth: Option[Int], subbuilders: List[(String, Scallop)]) extends Product with Serializable

The main builder class.

args

Arguments to parse.

opts

Options definitions.

vers

Version string to display in help.

bann

Banner (summary of this program and command-line usage) to display in help.

foot

Footer - displayed after options.

Source
Scallop.scala
Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. Scallop
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Scallop(args: Seq[String] = immutable.this.Nil, opts: List[CliOption] = immutable.this.Nil, vers: Option[String] = scala.None, bann: Option[String] = scala.None, foot: Option[String] = scala.None, optionSetValidations: List[(List[String]) ⇒ Either[String, Unit]] = immutable.this.Nil, helpWidth: Option[Int] = scala.None, subbuilders: List[(String, Scallop)] = immutable.this.Nil)

    args

    Arguments to parse.

    opts

    Options definitions.

    vers

    Version string to display in help.

    bann

    Banner (summary of this program and command-line usage) to display in help.

    foot

    Footer - displayed after options.

Type Members

  1. case class ParseResult(opts: List[(CliOption, (String, List[String]))], subcommand: Option[String], subcommandArgs: List[String]) extends Product with Serializable

  2. type Parsed = List[(CliOption, (String, List[String]))]

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def addSubBuilder(name: String, builder: Scallop): Scallop

    Adds a subbuilder (subcommand) to this builder.

    Adds a subbuilder (subcommand) to this builder.

    name

    All arguments after this string would be routed to this builder.

  7. def apply[A](name: Char)(implicit m: Manifest[A]): A

  8. def apply[A](name: String)(implicit m: Manifest[A]): A

    Get the value of option.

    Get the value of option. If option is not found, this will throw an exception.

    name

    Name for option.

    m

    Manifest for requested type. Usually found implicitly.

  9. def args(a: Seq[String]): Scallop

    Add some more arguments to this builder.

    Add some more arguments to this builder. They are appended to the end of the original list.

    a

    arg list to add

  10. val args: Seq[String]

    Arguments to parse.

  11. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  12. val bann: Option[String]

    Banner (summary of this program and command-line usage) to display in help.

  13. def banner(b: String): Scallop

    Add banner string to this builder.

    Add banner string to this builder. Banner should describe your program and provide a short summary on it's usage.

    b

    Banner string, can contain multiple lines. Note this is not formatted to 80 characters!

  14. def canEqual(arg0: Any): Boolean

    Definition Classes
    Scallop → Equals
  15. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  16. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean

    Definition Classes
    Scallop → Equals → AnyRef → Any
  18. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  19. val foot: Option[String]

    Footer - displayed after options.

  20. def footer(f: String): Scallop

    Add footer string to this builder.

    Add footer string to this builder. Footer will be printed in help after option definitions.

    f

    Footer string, can contain multiple lines. Note this is not formatted to 80 characters!

  21. def get[A](name: Char)(implicit m: Manifest[A]): Option[A]

  22. def get[A](name: String)(implicit m: Manifest[A]): Option[A]

    Get the value of option (or trailing arg) as Option.

    Get the value of option (or trailing arg) as Option.

    name

    Name for option.

    m

    Manifest for requested type. Usually found implicitly.

  23. def getAllSuppliedOptionNames: List[String]

    Retrieves a list of all supplied options (including options from subbuilders).

  24. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  25. def getOptionShortNames(opt: CliOption): List[Char]

  26. def getOptionWithShortName(c: Char): Option[CliOption]

    Find an option, that responds to this short name.

  27. def getSubcommandName: Option[String]

    Retrieves name of the subcommand that was found in input arguments.

  28. def getSubcommandNames: List[String]

    Returns the list of subcommand names, recursively.

  29. def hashCode(): Int

    Definition Classes
    Scallop → AnyRef → Any
  30. def help: String

    Get help on options from this builder.

    Get help on options from this builder. The resulting help is carefully formatted to required number of columns (default = 80, change with .setHelpWidth method), and contains info on proporties and options. It does not contain info about trailing arguments.

  31. val helpWidth: Option[Int]

  32. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  33. def isSupplied(name: String): Boolean

    Tests if this option or trailing arg was explicitly provided by argument list (not from default).

    Tests if this option or trailing arg was explicitly provided by argument list (not from default).

    name

    Identifier of option or trailing arg definition

  34. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  35. final def notify(): Unit

    Definition Classes
    AnyRef
  36. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  37. def opt[A](name: String, short: Char, descr: String, default: Option[A], validate: (A) ⇒ Boolean, required: Boolean, arg: String, hidden: Boolean, noshort: Boolean)(implicit conv: ValueConverter[A]): Scallop

    Add a new option definition to this builder.

    Add a new option definition to this builder.

    name

    Name for new option, used as long option name in parsing, and for option identification.

    short

    Overload the char that will be used as short option name. Defaults to first character of the name.

    descr

    Description for this option, for help description.

    default

    Default value to use if option is not found in input arguments (if you provide this, you can omit the type on method).

    validate

    The function, that validates the parsed value

    required

    Is this option required? Defaults to false.

    arg

    The name for this ortion argument, as it will appear in help. Defaults to "arg".

    hidden

    Hides description of this option from help (this can be useful for debugging options)

    noshort

    If set to true, then this option does not have any short name.

    conv

    The converter for this option. Usually found implicitly.

  38. val optionSetValidations: List[(List[String]) ⇒ Either[String, Unit]]

  39. val opts: List[CliOption]

    Options definitions.

  40. def printHelp: Unit

    Print help message (with version, banner, option usage and footer) to stdout.

  41. def productArity: Int

    Definition Classes
    Scallop → Product
  42. def productElement(arg0: Int): Any

    Definition Classes
    Scallop → Product
  43. def productIterator: Iterator[Any]

    Definition Classes
    Product
  44. def productPrefix: String

    Definition Classes
    Scallop → Product
  45. def prop[A](name: Char, key: String)(implicit m: Manifest[Map[String, A]]): Option[A]

  46. def props[A](name: Char, descr: String = "", keyName: String = "key", valueName: String = "value", hidden: Boolean = false)(implicit conv: ValueConverter[Map[String, A]]): Scallop

    Add new property option definition to this builder.

    Add new property option definition to this builder.

    name

    Char, that will be used as prefix for property arguments.

    descr

    Description for this property option, for help description.

    keyName

    Name for 'key' part of this option arg name, as it will appear in help option definition. Defaults to "key".

    valueName

    Name for 'value' part of this option arg name, as it will appear in help option definition. Defaults to "value".

  47. def propsLong[A](name: String, descr: String = "", keyName: String = "key", valueName: String = "value", hidden: Boolean = false)(implicit conv: ValueConverter[Map[String, A]]): Scallop

  48. def setHelpWidth(w: Int): Scallop

    Explicitly sets the needed width for the help printout.

  49. val subbuilders: List[(String, Scallop)]

  50. def summary: String

    Get summary of current parser state.

    Get summary of current parser state.

    Returns a list of all options in the builder, and corresponding values for them.

  51. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  52. def toString(): String

    Definition Classes
    Scallop → AnyRef → Any
  53. def toggle(name: String, default: Option[Boolean] = None, short: Char = 0.toChar, noshort: Boolean = false, prefix: String = "no", descrYes: String = "", descrNo: String = "", hidden: Boolean = false): Scallop

  54. def trailArg[A](name: String, required: Boolean, descr: String, default: Option[A], validate: (A) ⇒ Boolean, hidden: Boolean)(implicit conv: ValueConverter[A]): Scallop

    Add new trailing argument definition to this builder.

    Add new trailing argument definition to this builder.

    name

    Name for new definition, used for identification.

    required

    Is this trailing argument required? Defaults to true.

    default

    If this argument is not required and not found in the argument list, use this value.

    validate

    The function, that validates the parsed value

  55. def validationSet(fn: (List[String]) ⇒ Either[String, Unit]): Scallop

    Add a validation for supplied option set.

    Add a validation for supplied option set.

    fn

    A function, that accepts the list of names of options, that are supplied. It should return a Left with error message in case of validation failure.

  56. def verify: Scallop

    Verify the builder.

    Verify the builder. Parses arguments, makes sure no definitions clash, no garbage or unknown options are present, and all present arguments are in proper format. It is recommended to call this method before using the results.

    If there is "--help" or "--version" option present, it prints help or version statement and exits.

  57. val vers: Option[String]

    Version string to display in help.

  58. def version(v: String): Scallop

    Add version string to this builder.

    Add version string to this builder.

    v

    Version string, to be printed before all other things in help.

  59. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Deprecated Value Members

  1. def productElements: Iterator[Any]

    Definition Classes
    Product
    Annotations
    @deprecated
    Deprecated

    (Since version 2.8.0) use productIterator instead

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any