Prompt
abstract class Prompt<T>(prompt: String, val terminal: Terminal, default: T? = null, showDefault: Boolean = true, showChoices: Boolean = true, hideInput: Boolean = false, choices: Collection<T> = emptyList(), promptSuffix: String = ": ", invalidChoiceMessage: String = "Invalid value, choose from ")
The base class for prompts.
ask will print the prompt and ask for a line of user input and return the result of passing that line to convert. If convert instead returns ConversionResult.Invalid, its message will be printed and the user will be asked for input again.
Theme styles used
prompt.prompt
: applied to the prompt stringprompt.choices
: applied to the rendered choices values when shown in the promptprompt.default
: applied to the rendered default value when shown in the promptprompt.choices.invalid
: applied to the invalidChoiceMessage when showndanger
: applied to the error message returned by convert