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

switch

fun Any> RawOption.switch(choices: Map<String, T>): FlagOption

Turn an option into a set of flags that each map to a value.

Example:

``` kotlin option().switch(mapOf(“–foo” to Foo(), “–bar” to Bar()))

fun Any> RawOption.switch(vararg choices: Pair<String, T>): FlagOption

Turn an option into a set of flags that each map to a value.

Example:

``` kotlin option().switch(“–foo” to Foo(), “–bar” to Bar())