class FlagOption<T> : OptionDelegate<T>
An Option that has no values.
FlagOption(names: Set<String>, secondaryNames: Set<String>, help: String, : Boolean, envvar: String?, transformEnvvar: OptionTransformContext.(String) -> T, transformAll: CallsTransformer<String, T>)
An Option that has no values. |
val envvar: String?
The name of the environment variable for this option. Overrides automatic names. |
|
val help: String
The description of this option, usually a single line. |
|
val hidden: Boolean
If true, this option should not appear in help output. |
|
val metavar: String?
A name representing the values for this option that can be displayed to the user. |
|
var names: Set<String>
The names that can be used to invoke this option. They must start with a punctuation character. |
|
val nvalues: Int
The number of values that must be given to this option. |
|
val parser: FlagOptionParser
The parser for this option's values. |
|
val secondaryNames: Set<String>
Names that can be used for a secondary purpose, like disabling flag options. |
|
val transformAll: CallsTransformer<String, T>
Called to transform all invocations of this option into the final option type. |
|
val transformEnvvar: OptionTransformContext.(String) -> T
Called to transform string values from envvars into the option type. |
fun finalize(context: Context, invocations: List<Invocation>): Unit
Called after this command's argv is parsed to transform and store the option's value. |
|
fun getValue(thisRef: CliktCommand, property: KProperty<*>): T |
|
operator fun provideDelegate(thisRef: CliktCommand, prop: KProperty<*>): ReadOnlyProperty<CliktCommand, T>
Implementations must call CliktCommand.registerOption |
fun <T : Any> FlagOption<T?>.default(value: T): FlagOption<T>
Set a default value for a option. |
|
fun <T : Any> FlagOption<T>.validate(validator: OptionValidator<T>): OptionDelegate<T>
Check the final option value and raise an error if it's not valid. |