OptionDelegate

Properties

Link copied to clipboard

If true, this option can be specified without a name e.g. -2 instead of -o2

Link copied to clipboard

If false, invocations must be of the form --foo=1 or -f1. If true, the forms --foo 1 and -f 1 are also accepted.

Link copied to clipboard

Optional set of strings to use when the user invokes shell autocomplete on a value for this option.

Link copied to clipboard
open val eager: Boolean

If true, the presence of this option on the command line will halt parsing immediately

Link copied to clipboard
abstract override var groupName: String?

The name of the group, or null if this option should not be grouped in the help output.

Link copied to clipboard
abstract val helpTags: Map<String, String>

Extra information about this option to pass to the help formatter.

Link copied to clipboard
abstract val hidden: Boolean

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

Link copied to clipboard
abstract val names: Set<String>

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

Link copied to clipboard
abstract val nvalues: IntRange

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

Link copied to clipboard

The group that this option belongs to, or null. Set by the group.

Link copied to clipboard
abstract val secondaryNames: Set<String>

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

Link copied to clipboard
abstract val value: T

The value for this option.

Link copied to clipboard
abstract val valueSourceKey: String?

Optional explicit key to use when looking this option up from a ValueSource

Functions

Link copied to clipboard
abstract fun finalize(context: Context, invocations: List<Invocation>)

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

Link copied to clipboard
open operator override fun getValue(thisRef: ParameterHolder, property: KProperty<*>): T
Link copied to clipboard
abstract fun metavar(context: Context): String?

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

Link copied to clipboard
abstract fun optionHelp(context: Context): String

The description of this option, usually a single line.

Link copied to clipboard

Information about this option for the help output.

Link copied to clipboard
abstract fun postValidate(context: Context)

Called after all of a command's parameters have been finalized to perform validation of the final value.

Link copied to clipboard
abstract operator override fun provideDelegate(thisRef: ParameterHolder, property: KProperty<*>): ReadOnlyProperty<ParameterHolder, T>

Implementations must call ParameterHolder.registerOption