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

OptionTransformContext

class OptionTransformContext : Option

A receiver for options transformers.

Constructors

<init>

OptionTransformContext(option: Option, context: Context)

A receiver for options transformers.

Properties

context

val context: Context

option

val option: Option

The option that was invoked

Functions

fail

fun fail(message: String): Nothing

Throw an exception indicating that usage was incorrect.

require

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

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