MapValueSource

class MapValueSource(values: Map<String, String>, getKey: (Context, Option) -> String) : ValueSource

A ValueSource that reads values from a map.

This implementation will only return a single value for each option. If you use conversions like pair or triple, you'll need to implement a ValueSource yourself.

Parameters

values

The map of key to value for each option

getKey

A function that return the key in values for a given option. By default, it joins the

Constructors

MapValueSource
Link copied to clipboard
common
fun MapValueSource(values: Map<String, String>, getKey: (Context, Option) -> String = ValueSource.getKey(joinSubcommands = "."))
The map of key to value for each option

Functions

getValues
Link copied to clipboard
common
open override fun getValues(context: Context, option: Option): List<ValueSource.Invocation>