Simon Marquis
11/14/2023, 11:09 AMmultiple()
and prompt()
to allow the user to provide values at runtime if nothing is provided.
Unfortunately, this does not seem to be supported.
What would be the recommended way to support this kind of behavior?
I'm currently using this, but this prevent me from using a prompt
val flavors: Set<Flavor> by option("-f", "--flavors")
.enum<Flavor>(ignoreCase = true)
.multiple(default = listOf(Main)).unique()
AJ Alt
11/14/2023, 4:56 PMmutliple
is just transformAll { it }
, and prompt
is just transformAll { it.lastOrNull() ?: terminal.prompt("") }
, so you can combine them like option().enum<>().transformAll { it.ifEmpty { listOf(terminal.prompt("..."))} }
Simon Marquis
11/14/2023, 5:16 PMgetValue
ReadOnlyProperty 🤔Set
👍