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

required

fun <EachT : Any, ValueT> NullableOption<EachT, ValueT>.required(): OptionWithValues<EachT, EachT, ValueT>

If the option is not called on the command line (and is not set in an envvar), throw a MissingParameter.

This must be applied after all other transforms.

Example:

val opt: Pair<Int, Int> by option().int().pair().required()