Scallop

case class Scallop(args: Seq[String], opts: List[CliOption], mainOptions: List[CliOption], optionGroups: List[(String, Seq[CliOption])], vers: Option[String], bann: Option[String], foot: Option[String], descr: String, helpWidth: Option[Int], shortSubcommandsHelp: Boolean, appendDefaultToDescription: Boolean, noshort: Boolean, helpFormatter: ScallopHelpFormatter, subbuilders: List[(String, Scallop)]) extends ScallopArgListLoader

Internal configuration builder.

Internal configuration builder.

trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Type members

Classlikes

case class CliOptionInvocation(opt: CliOption, invocation: String, args: List[String], error: Option[ScallopException])
case class ParseResult(opts: Parsed, subcommand: Option[String], subcommandArgs: List[String])

Types

Value members

Concrete methods

def addSubBuilder(nameAndAliases: Seq[String], builder: Scallop): Scallop

Adds a subbuilder (subcommand) to this builder.

Adds a subbuilder (subcommand) to this builder.

Value Params
name

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

def apply(name: String): Any

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

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

Value Params
name

Name for option.

def apply(name: Char): Any
def args(a: Seq[String]): Scallop

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

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

Value Params
a

arg list to add

def filteredSummary(blurred: Set[String]): String

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)

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)

Value Params
blurred

names of the options that should be hidden.

Returns

a list of all options in the builder

def findSubbuilder(name: String): Option[Scallop]

Traverses the tree of subbuilders, using the provided name.

Traverses the tree of subbuilders, using the provided name.

Value Params
name

Names of subcommand names, that lead to the needed builder, separated by \0.

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.

Value Params
name

Name for option.

def get(name: Char): Option[Any]
def getAllSuppliedOptionNames: List[String]

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

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

def getFullHelpString(): String

Get full help text (with version, banner, option usage and footer)

Get full help text (with version, banner, option usage and footer)

def getOptionShortNames(opt: CliOption): List[Char]
def getOptionWithShortName(c: Char): Option[CliOption]

Find an option, that responds to this short name.

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.

Retrieves the subbuilder object, that matches the name of the subcommand found in input arguments.

def getSubcommandArgs: List[String]

Returns the subcommand arguments.

Returns the subcommand arguments.

def getSubcommandName: Option[String]

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

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

def getSubcommandNames: List[String]

Returns the list of subcommand names, recursively.

Returns the list of subcommand names, recursively.

def help: String

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.

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.

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

Value Params
name

Identifier of option or trailing arg definition

def printHelp(): Unit

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

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

def prop(name: Char, key: String): Option[Any]
def setHelpWidth(w: Int): Scallop

Explicitly sets the needed width for the help printout.

Explicitly sets the needed width for the help printout.

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.

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.

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.

def version(v: String): Scallop

Add version string to this builder.

Add version string to this builder.

Value Params
v

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

Inherited methods

def loadArgList(args: Seq[String]): Seq[String]
Inherited from
ScallopArgListLoader
def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product

Concrete fields

lazy val getVersionOption: Option[CliOption]
var parent: Option[Scallop]