clikt / com.github.ajalt.clikt.output / TermUi / confirm

confirm

fun confirm(text: String, default: Boolean = false, abort: Boolean = false, promptSuffix: String = “: “, showDefault: Boolean = true, console: CliktConsole = defaultCliktConsole()): Boolean?

Prompt for user confirmation.

Responses will be read from stdin, even if it’s redirected to a file.

Parameters

text - the question to ask

default - the default, used if stdin is empty

abort - if true, a negative answer aborts the program by raising Abort

promptSuffix - a string added after the question and choices

showDefault - if false, the choices will not be shown in the prompt.

Return the user’s response, or null if stdin is not interactive and EOF was encountered.