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

EagerOption

class EagerOption : StaticallyGroupedOption

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

Parameters

callback - This callback is called when the option is encountered on the command line. If you want to print a message and halt execution normally, you should throw a PrintMessage exception. If you want to exit normally without printing a message, you should throw Abort(error=false). The callback is passed the current execution context as a parameter.

Constructors

Name Summary
<init> EagerOption(vararg names:String, nvalues:Int= 0, help:String= "", hidden:Boolean= false, helpTags:Map<String,String> = emptyMap(), groupName:String? = null, callback:OptionTransformContext.() ->Unit)
An Option with no values that is finalized before other types of options.EagerOption(names:Set<String>, nvalues:Int, help:String, hidden:Boolean, helpTags:Map<String,String>, groupName:String?, callback:OptionTransformContext.() ->Unit)

Properties

Name Summary
groupName The name of the group, or null if this option should not be grouped in the help output.val groupName:String?
help The description of this option, usually a single line.val help:String
helpTags Extra information about this option to pass to the help formatter.val helpTags:Map<String,String>
hidden If true, this option should not appear in help output.val hidden:Boolean
metavar A name representing the values for this option that can be displayed to the user.val metavar:String?
names The names that can be used to invoke this option. They must start with a punctuation character.val names:Set<String>
nvalues The number of values that must be given to this option.val nvalues:Int
parser The parser for this option’s values.val parser:OptionParser
secondaryNames Names that can be used for a secondary purpose, like disabling flag options.val secondaryNames:Set<String>

Functions

Name Summary
finalize Called after this command’s argv is parsed to transform and store the option’s value.fun finalize(context:Context, invocations:List<Invocation>):Unit
postValidate Called after all of a command’s parameters have been finalized to perform validation of the final value.fun postValidate(context:Context):Unit