Skip to content

OptionSpec

extendsParamSpec

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

ParamSpec.kt

Constructors

OptionSpec

OptionSpec(names: List<String>, converter: Converter<*>, help: String, required: Boolean, default: Any?, multiple: Boolean)
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.

ParamSpec.kt

Properties

converter

val converter: Converter<*>
ParamSpec.kt

default

val default: Any?
ParamSpec.kt

help

open override val help: String
ParamSpec.kt

multiple

val multiple: Boolean
ParamSpec.kt

names

val names: List<String>
ParamSpec.kt

primaryName

val primaryName: String

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

ParamSpec.kt

required

val required: Boolean
ParamSpec.kt

Released under the Apache License 2.0.