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

OptionDelegate

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

An option that functions as a property delegate

Inherited 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

provideDelegate

abstract operator fun provideDelegate(thisRef: CliktCommand, prop: KProperty<*>): ReadOnlyProperty<CliktCommand, T>

Implementations must call CliktCommand.registerOption

Inherited 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

FlagOption

class FlagOption<T> : OptionDelegate<T>

An Option that has no values.

OptionWithValues

class OptionWithValues<AllT, EachT, ValueT> : OptionDelegate<AllT>

An Option that takes one or more values.