Skip to content

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

Name Summary
completionCandidates Optional set of strings to use when the user invokes shell autocomplete on a value for this option.open val completionCandidates:CompletionCandidates
helpTags Extra information about this option to pass to the help formatter.abstract val helpTags:Map<String,String>
hidden If true, this option should not appear in help output.abstract val hidden:Boolean
names The names that can be used to invoke this option. They must start with a punctuation character.abstract val names:Set<String>
nvalues The number of values that must be given to this option.abstract val nvalues:Int
optionHelp The description of this option, usually a single line.abstract val optionHelp:String
parser The parser for this option’s values.abstract val parser:OptionParser
secondaryNames Names that can be used for a secondary purpose, like disabling flag options.abstract val secondaryNames:Set<String>
valueSourceKey Optional explicit key to use when looking this option up from a ValueSourceabstract val valueSourceKey:String?

Functions

Name Summary
finalize Called after this command’s argv is parsed to transform and store the option’s value.abstract fun finalize(context:Context, invocations:List<Invocation>):Unit
metavar A name representing the values for this option that can be displayed to the user.abstract fun metavar(context:Context):String?
parameterHelp Information about this option for the help output.open fun parameterHelp(context:Context): Option?
postValidate Called after all of a command’s parameters have been finalized to perform validation of the final value.abstract fun postValidate(context:Context):Unit

Inheritors

Name Summary
OptionCallTransformContext A receiver for options transformers.class OptionCallTransformContext :Option
OptionTransformContext A receiver for options transformers.class OptionTransformContext :Option
StaticallyGroupedOption interface StaticallyGroupedOption :Option