clikt / com.github.ajalt.clikt.parameters.options / Option

Option

interface Option

An optional command line parameter that takes a fixed number of values.

Options can take any fixed number of values, including 0.

Properties

help

abstract val help: String

The description of this option, usually a single line.

hidden

abstract val hidden: Boolean

If true, this option should not appear in help output.

metavar

abstract val metavar: String?

A name representing the values for this option that can be displayed to the user.

names

abstract val names: Set<String>

The names that can be used to invoke this option. They must start with a punctuation character.

nvalues

abstract val nvalues: Int

The number of values that must be given to this option.

parameterHelp

open val parameterHelp: Option?

Information about this option for the help output.

parser

abstract val parser: OptionParser

The parser for this option's values.

secondaryNames

abstract val secondaryNames: Set<String>

Names that can be used for a secondary purpose, like disabling flag options.

Functions

finalize

abstract fun finalize(context: Context, invocations: List<Invocation>): Unit

Called after this command's argv is parsed to transform and store the option's value.

Inheritors

EagerOption

class EagerOption : Option

An Option with no values that is finalized before other types of options.

OptionCallTransformContext

class OptionCallTransformContext : Option

A receiver for options transformers.

OptionDelegate

interface OptionDelegate<out T> : Option, ReadOnlyProperty<CliktCommand, T>

An option that functions as a property delegate

OptionTransformContext

class OptionTransformContext : Option

A receiver for options transformers.