fun <T : Any> NullableOption<T, T>.prompt(text: String? = null, default: String? = null, hideInput: Boolean = false, requireConfirmation: Boolean = false, confirmationPrompt: String = "Repeat for confirmation: ", promptSuffix: String = ": ", showDefault: Boolean = true): OptionWithValues<T, T, T>

If the option isn't given on the command line, prompt the user for manual input.

Note that if the option is defined with a validate or check, that validation will be run each time the user enters a value. This means that, unlike normal options, the validation for prompt options cannot reference other parameters.



The text to prompt the user with


The default value to use if no input is given. If null, the prompt will be repeated until input is given.


If true, user input will not be shown on the screen. Useful for passwords and sensitive input.


If true, the user will be required to enter the same value twice before it is accepted.


If requireConfirmation is true, this will be used to ask for input again.


Text to display directly after text. Defaults to ": ".


Show default to the user in the prompt.