OptionCallTransformContext

class OptionCallTransformContext(name: String, option: Option, context: Context) : Option

A receiver for options transformers.

Constructors

OptionCallTransformContext
Link copied to clipboard
common
fun OptionCallTransformContext(name: String, option: Option, context: Context)

Functions

fail
Link copied to clipboard
common
fun fail(message: String): Nothing
Throw an exception indicating that an invalid value was provided.
finalize
Link copied to clipboard
common
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.
message
Link copied to clipboard
common
fun message(message: String)
Issue a message that can be shown to the user
metavar
Link copied to clipboard
common
open override fun metavar(context: Context): String?
A name representing the values for this option that can be displayed to the user.
parameterHelp
Link copied to clipboard
common
open override fun parameterHelp(context: Context): HelpFormatter.ParameterHelp.Option?
Information about this option for the help output.
postValidate
Link copied to clipboard
common
open override fun postValidate(context: Context)
Called after all of a command's parameters have been finalized to perform validation of the final value.
require
Link copied to clipboard
common
inline fun require(value: Boolean, lazyMessage: () -> String = { "" })
If value is false, call fail with the output of lazyMessage

Properties

completionCandidates
Link copied to clipboard
common
open override val completionCandidates: CompletionCandidates
Optional set of strings to use when the user invokes shell autocomplete on a value for this option.
context
Link copied to clipboard
common
val context: Context
helpTags
Link copied to clipboard
common
open override val helpTags: Map<String, String>
Extra information about this option to pass to the help formatter.
hidden
Link copied to clipboard
common
open override val hidden: Boolean
If true, this option should not appear in help output.
name
Link copied to clipboard
common
val name: String
The name that was used to invoke this option.
names
Link copied to clipboard
common
open override val names: Set<String>
The names that can be used to invoke this option.
nvalues
Link copied to clipboard
common
open override val nvalues: Int
The number of values that must be given to this option.
option
Link copied to clipboard
common
val option: Option
The option that was invoked
optionHelp
Link copied to clipboard
common
open override val optionHelp: String
The description of this option, usually a single line.
parser
Link copied to clipboard
common
open override val parser: OptionParser
The parser for this option's values.
secondaryNames
Link copied to clipboard
common
open override val secondaryNames: Set<String>
Names that can be used for a secondary purpose, like disabling flag options.
valueSourceKey
Link copied to clipboard
common
open override val valueSourceKey: String?
Optional explicit key to use when looking this option up from a ValueSource