prompt Until
abstract suspend fun <T> promptUntil( argument: Argument<*, T>, prompt: String, error: String, isValid: (T) -> Boolean): T
Content copied to clipboard
Prompt the user with a String. Re-prompt until the response converts correctly. Then apply a custom predicate as an additional check.
Parameters
argument
The Argument that the prompt expects in response.
prompt
The string message sent to the user as a prompt for information.
error
The error String to send when the input fails the custom check.
is Valid
A predicate to determine whether the input is accepted.