OptionSpec

class OptionSpec(val names: List<String>, val converter: Converter<*>, val help: String = "", val required: Boolean = false, val default: Any? = null, val multiple: Boolean = false) : ParamSpec

A named parameter that takes a value, for example --count 3, --count=3, or -c 3.

Parameters

names

the option's names, primary first, for example ["--count", "-c"].

converter

converts each raw value to the typed result.

help

help text for --help.

required

whether at least one occurrence must be supplied.

default

the already-converted value used when a single-valued option is absent.

multiple

when true repeats accumulate into a list; when false a second occurrence is an ArgotParseException.DuplicateValue.

Constructors

Link copied to clipboard
constructor(names: List<String>, converter: Converter<*>, help: String = "", required: Boolean = false, default: Any? = null, multiple: Boolean = false)

Properties

Link copied to clipboard
Link copied to clipboard
val default: Any?
Link copied to clipboard
open override val help: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The first of names, used as the lookup key in ParsedValues.

Link copied to clipboard