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

OptionCallTransformContext

class OptionCallTransformContext : Option

A receiver for options transformers.

Constructors

<init>

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

A receiver for options transformers.

Properties

context

val context: Context

name

val name: String

The name that was used to invoke this option.

option

val option: Option

The option that was invoked

Functions

fail

fun fail(message: String): Nothing

Throw an exception indicating that an invalid value was provided.

require

fun require(value: Boolean, lazyMessage: () -> String = { "invalid value" }): Unit

If value is false, call fail with the output of lazyMessage