switch

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

Example:

option().switch(mapOf("--foo" to Foo(), "--bar" to Bar()))

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

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

Example:

option().switch("--foo" to Foo(), "--bar" to Bar())