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

transformValues

fun Any, EachOutT : Any, ValueT> NullableOption.transformValues(nvalues: Int, transform: ArgsTransformer): NullableOption

Change the number of values that this option takes.

The input will be a list of size nvalues, with each item in the list being the output of a call to convert. nvalues must be 2 or greater, since options cannot take a variable number of values, and option has nvalues = 1 by default. If you want to change the type of an option with one value, use convert instead.

Used to implement functions like pair and triple. This must be applied before any other transforms.