multiple

fun <EachT : Any, ValueT> NullableOption<EachT, ValueT>.multiple(default: List<EachT> = emptyList(), required: Boolean = false): OptionWithValues<List<EachT>, EachT, ValueT>

Make the option return a list of calls; each item in the list is the value of one call.

If the option is never called, the list will be empty. This must be applied after all other transforms.

Example:

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

Parameters

default

The value to use if the option is not supplied. Defaults to an empty list.

required

If true, default is ignored and MissingOption will be thrown if no instances of the option are present on the command line.