MapValueSource

class MapValueSource(values: Map<String, String>, getKey: (Context, Option) -> String = ValueSource.getKey(joinSubcommands = ".")) : 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

Link copied to clipboard
constructor(values: Map<String, String>, getKey: (Context, Option) -> String = ValueSource.getKey(joinSubcommands = "."))

Functions

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