package scallop
- Source
- package.scala
- Alphabetic
- By Inheritance
- scallop
- DefaultConverters
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Package Members
- package exceptions
Type Members
- sealed trait CliOption extends AnyRef
- trait DefaultConverters extends AnyRef
- case class HelpInfo(argLine: String, description: String, defaultValue: () => Option[String]) extends Product with Serializable
- class LazyMap[A, +B] extends Map[A, B]
A class, that lazily encapsulates a map inside.
- case class LongNamedPropertyOption(name: String, descr: String, converter: ValueConverter[_], keyName: String, valueName: String, hidden: Boolean) extends CliOption with Product with Serializable
- case class NumberArgOption(name: String, required: Boolean, descr: String, converter: ValueConverter[Long], validator: (Any) => Boolean, default: () => Option[Long], hidden: Boolean) extends CliOption with Product with Serializable
- case class PropertyOption(name: String, short: Char, descr: String, converter: ValueConverter[_], keyName: String, valueName: String, hidden: Boolean) extends CliOption with Product with Serializable
- case class Scallop(args: Seq[String] = Nil, opts: List[CliOption] = Nil, mainOpts: List[String] = 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
The main builder class.
The main builder class.
- args
Arguments to parse.
- opts
Options definitions.
- mainOpts
Names of options, that are to be printed first in the help printout
- 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.
- descr
Short description - used for subcommands
- helpWidth
Width, to which the help output will be formatted (note that banner, footer, version and description are not affected!)
- shortSubcommandsHelp
If true, then help output from this builder wouldn't list full help for subcommands, only short description
- appendDefaultToDescription
If true, then append auto-generated text about default option value to option descriptions
- noshort
If true, then do not generate short names for options by default unless overridden per option by providing its noshort parameter
- helpFormatter
help formatter in this builder
- subbuilders
subcommands in this builder
- trait ScallopArgListLoader extends AnyRef
- abstract class ScallopConf extends ScallopConfBase
- abstract class ScallopConfBase extends ScallopConfValidations
- trait ScallopConfValidations extends AnyRef
Helper trait for generaton of
validate
methods on ScallopConf. - class ScallopHelpFormatter extends AnyRef
- abstract class ScallopOption[A] extends AnyRef
A class to hold a reference to not-yet-computed option values.
A class to hold a reference to not-yet-computed option values.
Basically, this is a lazy option - it batches up all operations, and evaluates the value only as the last resort.
- trait Serialization extends Serializable
Use this trait to make your ScallopConf serializable.
Use this trait to make your ScallopConf serializable. Warning: this serialization method expects your ScallopConf class to have public constructor that accepts Seq[String] or List[String] as a single parameter.
If your class does not have such constructor, you will need to implement serialization/deserialization logic yourself (see https://github.com/scallop/scallop/issues/137)
- class SerializationProxy extends Serializable
- case class SimpleOption(name: String, short: Option[Char], descr: String, required: Boolean, converter: ValueConverter[_], default: () => Option[Any], validator: (Any) => Boolean, argName: String, hidden: Boolean, noshort: Boolean) extends CliOption with Product with Serializable
- class Subcommand extends ScallopConf
- case class ToggleOption(name: String, default: () => Option[Boolean], short: Option[Char], noshort: Boolean, prefix: String, descrYes: String, descrNo: String, hidden: Boolean) extends CliOption with Product with Serializable
- case class TrailingArgsOption(name: String, required: Boolean, descr: String, converter: ValueConverter[_], validator: (Any) => Boolean, default: () => Option[Any], hidden: Boolean) extends CliOption with Product with Serializable
- trait ValueConverter[A] extends AnyRef
Converter from list of plain strings to something meaningful.
Value Members
- implicit val bigDecimalConverter: ValueConverter[BigDecimal]
- Definition Classes
- DefaultConverters
- implicit val bigIntConverter: ValueConverter[BigInt]
- Definition Classes
- DefaultConverters
- implicit val byteConverter: ValueConverter[Byte]
- Definition Classes
- DefaultConverters
- implicit val byteListConverter: ValueConverter[List[Byte]]
- Definition Classes
- DefaultConverters
- implicit val bytePropsConverter: ValueConverter[Map[String, Byte]]
- Definition Classes
- DefaultConverters
- implicit val charConverter: ValueConverter[Char]
- Definition Classes
- DefaultConverters
- implicit val charPropsConverter: ValueConverter[Map[String, Char]]
- Definition Classes
- DefaultConverters
- implicit val doubleConverter: ValueConverter[Double]
- Definition Classes
- DefaultConverters
- implicit val doubleListConverter: ValueConverter[List[Double]]
- Definition Classes
- DefaultConverters
- implicit val doublePropsConverter: ValueConverter[Map[String, Double]]
- Definition Classes
- DefaultConverters
- implicit val durationConverter: ValueConverter[Duration]
- Definition Classes
- DefaultConverters
- implicit val fileConverter: ValueConverter[File]
- implicit val fileListConverter: ValueConverter[List[File]]
- implicit val finiteDurationConverter: ValueConverter[FiniteDuration]
- Definition Classes
- DefaultConverters
- implicit val flagConverter: ValueConverter[Boolean]
- Definition Classes
- DefaultConverters
- implicit val floatConverter: ValueConverter[Float]
- Definition Classes
- DefaultConverters
- implicit val floatListConverter: ValueConverter[List[Float]]
- Definition Classes
- DefaultConverters
- implicit val floatPropsConverter: ValueConverter[Map[String, Float]]
- Definition Classes
- DefaultConverters
- implicit val intConverter: ValueConverter[Int]
- Definition Classes
- DefaultConverters
- implicit val intListConverter: ValueConverter[List[Int]]
- Definition Classes
- DefaultConverters
- implicit val intPropsConverter: ValueConverter[Map[String, Int]]
- Definition Classes
- DefaultConverters
- def listArgConverter[A](conv: (String) => A): ValueConverter[List[A]]
- Definition Classes
- DefaultConverters
- implicit val longConverter: ValueConverter[Long]
- Definition Classes
- DefaultConverters
- implicit val longListConverter: ValueConverter[List[Long]]
- Definition Classes
- DefaultConverters
- implicit val longPropsConverter: ValueConverter[Map[String, Long]]
- Definition Classes
- DefaultConverters
- def numberHandler[T](name: String): PartialFunction[Throwable, Either[String, Option[T]]]
Handler function for numeric types which expects a NumberFormatException and prints a more helpful error message.
Handler function for numeric types which expects a NumberFormatException and prints a more helpful error message.
- name
the type name to display
- Definition Classes
- DefaultConverters
- def optDefault[A](default: A)(implicit conv: ValueConverter[A]): ValueConverter[A]
- Definition Classes
- DefaultConverters
- implicit val pathConverter: ValueConverter[Path]
- def propsConverter[A](conv: ValueConverter[A]): ValueConverter[Map[String, A]]
- Definition Classes
- DefaultConverters
- implicit val shortConverter: ValueConverter[Short]
- Definition Classes
- DefaultConverters
- implicit val shortListConverter: ValueConverter[List[Short]]
- Definition Classes
- DefaultConverters
- implicit val shortPropsConverter: ValueConverter[Map[String, Short]]
- Definition Classes
- DefaultConverters
- def singleArgConverter[A](conv: (String) => A, handler: PartialFunction[Throwable, Either[String, Option[A]]] = PartialFunction.empty): ValueConverter[A]
Create a converter for an argument with a single value.
Create a converter for an argument with a single value.
- conv
the conversion function to use, which may throw an exception on error
- handler
an error handler function for writing custom error messages
- Definition Classes
- DefaultConverters
- implicit val stringConverter: ValueConverter[String]
- Definition Classes
- DefaultConverters
- implicit val stringListConverter: ValueConverter[List[String]]
- Definition Classes
- DefaultConverters
- implicit val stringPropsConverter: ValueConverter[Map[String, String]]
- Definition Classes
- DefaultConverters
- val tallyConverter: ValueConverter[Int]
- Definition Classes
- DefaultConverters
- implicit val uriConverter: ValueConverter[URI]
- implicit val urlConverter: ValueConverter[URL]
- object ArgType
An enumeration of possible arg types by number of arguments they can take.
- object Compat
- object Formatter
- object TrailingArgumentsParser
Parses the trailing arguments (including the arguments to last option).
Parses the trailing arguments (including the arguments to last option). Uses simple backtraking algorithm.
- object Util
- object overrideColorOutput extends DynamicVariable[Option[Boolean]]
- object throwError extends DynamicVariable[Boolean]
Convenience variable to permit testing.