promptUntil

abstract suspend fun <T> promptUntil(    argument: Argument<*, T>,     prompt: String,     error: String,     isValid: (T) -> Boolean): T

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.

isValid

A predicate to determine whether the input is accepted.