EagerOption

class EagerOption(names: Set<String>, nvalues: Int, optionHelp: String, hidden: Boolean, helpTags: Map<String, String>, groupName: String?, callback: OptionTransformContext.() -> Unit) : 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

Link copied to clipboard
fun EagerOption(vararg names: String, nvalues: Int = 0, help: String = "", hidden: Boolean = false, helpTags: Map<String, String> = emptyMap(), groupName: String? = null, callback: OptionTransformContext.() -> Unit)
Link copied to clipboard
fun EagerOption(names: Set<String>, nvalues: Int, optionHelp: String, hidden: Boolean, helpTags: Map<String, String>, groupName: String?, callback: OptionTransformContext.() -> Unit)

Functions

Link copied to clipboard
open override fun finalize(context: Context, invocations: List<OptionParser.Invocation>)

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

Link copied to clipboard
open override fun metavar(context: Context): String?

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

Link copied to clipboard
open fun parameterHelp(context: Context): HelpFormatter.ParameterHelp.Option?

Information about this option for the help output.

Link copied to clipboard
open override fun postValidate(context: Context)

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

Properties

Link copied to clipboard
open val completionCandidates: CompletionCandidates

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

Link copied to clipboard
open override val groupName: String?

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

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

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

Link copied to clipboard
open override val hidden: Boolean

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

Link copied to clipboard
open override 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
open override val nvalues: Int

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

Link copied to clipboard
open override val optionHelp: String

The description of this option, usually a single line.

Link copied to clipboard
open override val parser: OptionParser

The parser for this option's values.

Link copied to clipboard
open override val secondaryNames: Set<String>

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

Link copied to clipboard
open override val valueSourceKey: String?

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