required

fun <T : Any> FlagOption<T?>.required(): FlagOption<T>

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

This must be applied after all other transforms.

Example:

option().switch("--foo" to Foo(), "--bar" to Bar()).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 MissingOption.

This must be applied after all other transforms.

Example:

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