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

TermUi

object TermUi

Properties

isWindows

val isWindows: Boolean

True if the current platform is a version of windows.

Functions

confirm

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

Prompt for user confirmation.

echo

fun echo(message: Any?, trailingNewline: Boolean = true, err: Boolean = false, console: CliktConsole = defaultCliktConsole()): Unit

Print the message to the screen.

editFile

fun editFile(filename: String, editor: String? = null, env: Map<String, String> = emptyMap(), requireSave: Boolean = false, extension: String = ".txt"): Unit

Edit the file with filename in the editor.

editText

fun editText(text: String, editor: String? = null, env: Map<String, String> = emptyMap(), requireSave: Boolean = false, extension: String = ".txt"): String?

Edit text in the editor.

prompt

fun <T> prompt(text: String, default: String? = null, hideInput: Boolean = false, requireConfirmation: Boolean = false, confirmationPrompt: String = "Repeat for confirmation: ", promptSuffix: String = ": ", showDefault: Boolean = true, console: CliktConsole = defaultCliktConsole(), convert: (String) -> T): T?

Prompt a user for text input.

fun prompt(text: String, default: String? = null, hideInput: Boolean = false, requireConfirmation: Boolean = false, confirmationPrompt: String = "Repeat for confirmation: ", promptSuffix: String = ": ", showDefault: Boolean = true): String?