case class Scallop(args: Seq[String] = Nil, opts: List[CliOption] = Nil, mainOptions: List[CliOption] = Nil, optionGroups: List[(String, Seq[CliOption])] = Nil, vers: Option[String] = None, bann: Option[String] = None, foot: Option[String] = None, descr: String = "", helpWidth: Option[Int] = None, shortSubcommandsHelp: Boolean = false, appendDefaultToDescription: Boolean = false, noshort: Boolean = false, helpFormatter: ScallopHelpFormatter = new ScallopHelpFormatter, subbuilders: List[(String, Scallop)] = Nil) extends ScallopArgListLoader with Product with Serializable
- Alphabetic
- By Inheritance
- Scallop
- Serializable
- Product
- Equals
- ScallopArgListLoader
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Scallop(args: Seq[String] = Nil, opts: List[CliOption] = Nil, mainOptions: List[CliOption] = Nil, optionGroups: List[(String, Seq[CliOption])] = Nil, vers: Option[String] = None, bann: Option[String] = None, foot: Option[String] = None, descr: String = "", helpWidth: Option[Int] = None, shortSubcommandsHelp: Boolean = false, appendDefaultToDescription: Boolean = false, noshort: Boolean = false, helpFormatter: ScallopHelpFormatter = new ScallopHelpFormatter, subbuilders: List[(String, Scallop)] = Nil)
Type Members
- case class CliOptionInvocation(opt: CliOption, invocation: String, args: List[String], error: Option[ScallopException] = None) extends Product with Serializable
- case class ParseResult(opts: Parsed = Nil, subcommand: Option[String] = None, subcommandArgs: List[String] = Nil) extends Product with Serializable
- type Parsed = List[CliOptionInvocation]
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addSubBuilder(nameAndAliases: Seq[String], builder: Scallop): Scallop
Adds a subbuilder (subcommand) to this builder.
- val appendDefaultToDescription: Boolean
- def appendOption(option: CliOption): Scallop
- def apply(name: Char): Any
- def apply(name: String): Any
Get the value of option.
Get the value of option. If option is not found, this will throw an exception.
- name
Name for option.
- 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
- val args: Seq[String]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val bann: Option[String]
- 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!
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- val descr: String
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def filteredSummary(blurred: Set[String]): String
Get summary of current parser state, hididng values for some of the options.
Get summary of current parser state, hididng values for some of the options. Useful if you log the summary and want to avoid storing sensitive information in the logs (like passwords)
- blurred
names of the options that should be hidden.
- returns
a list of all options in the builder
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def findSubbuilder(name: String): Option[Scallop]
Traverses the tree of subbuilders, using the provided name.
Traverses the tree of subbuilders, using the provided name.
- name
Names of subcommand names, that lead to the needed builder, separated by \\0.
- val foot: Option[String]
- 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!
- def get(name: Char): Option[Any]
- def get(name: String): Option[Any]
Get the value of option (or trailing arg) as Option.
Get the value of option (or trailing arg) as Option.
- name
Name for option.
- def getAllSuppliedOptionNames: List[String]
Retrieves a list of all supplied options (including options from subbuilders).
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getFullHelpString(): String
Get full help text (with version, banner, option usage and footer)
- lazy val getHelpOption: CliOption
- def getOptionShortNames(opt: CliOption): List[Char]
- def getOptionWithShortName(c: Char): Option[CliOption]
Find an option, that responds to this short name.
- def getSubbuilder: Option[Scallop]
Retrieves the subbuilder object, that matches the name of the subcommand found in input arguments.
- def getSubcommandArgs: List[String]
Returns the subcommand arguments.
- def getSubcommandName: Option[String]
Retrieves name of the subcommand that was found in input arguments.
- def getSubcommandNames: List[String]
Returns the list of subcommand names, recursively.
- lazy val getVersionOption: Option[CliOption]
- 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 properties, options and trailing arguments.
- val helpFormatter: ScallopHelpFormatter
- val helpWidth: Option[Int]
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- 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
- def loadArgList(args: Seq[String]): Seq[String]
- Definition Classes
- ScallopArgListLoader
- val mainOptions: List[CliOption]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val noshort: Boolean
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val optionGroups: List[(String, Seq[CliOption])]
- val opts: List[CliOption]
- var parent: Option[Scallop]
- def printHelp(): Unit
Print help message (with version, banner, option usage and footer) to stdout.
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def prop(name: Char, key: String): Option[Any]
- def setHelpWidth(w: Int): Scallop
Explicitly sets the needed width for the help printout.
- val shortSubcommandsHelp: Boolean
- val subbuilders: List[(String, Scallop)]
- 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.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- 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.
- val vers: Option[String]
- 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.
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()