ArgumentTransformContext

class ArgumentTransformContext(argument: Argument, context: Context) : Argument

A receiver for argument transformers.

Constructors

ArgumentTransformContext
Link copied to clipboard
common
fun ArgumentTransformContext(argument: Argument, context: Context)

Functions

fail
Link copied to clipboard
common
fun fail(message: String): Nothing
Throw an exception indicating that usage was incorrect.
finalize
Link copied to clipboard
common
open override fun finalize(context: Context, values: List<String>)
Called after this command's argv is parsed to transform and store the argument's value.
message
Link copied to clipboard
common
fun message(message: String)
Issue a message that can be shown to the user
parameterHelp
Link copied to clipboard
common
open override fun parameterHelp(context: Context): HelpFormatter.ParameterHelp.Argument?
Information about this argument 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

argument
Link copied to clipboard
common
val argument: Argument
The argument that was invoked
argumentHelp
Link copied to clipboard
common
open override val argumentHelp: String
The description of this argument.
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 argument.
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 argument to pass to the help formatter.
name
Link copied to clipboard
common
open override val name: String
The metavar for this argument.
nvalues
Link copied to clipboard
common
open override val nvalues: Int
The number of values that this argument takes.
required
Link copied to clipboard
common
open override val required: Boolean
If true, an error will be thrown if this argument is not given on the command line.