clikt / com.github.ajalt.clikt.output / CliktConsole

CliktConsole

interface CliktConsole

An object that is used by commands and parameters to show text to the user and read input.

By default, stdin and stdout are used, but you can provide an implementation of this interface to Context.console to customize the behavior.

Properties

lineSeparator

abstract val lineSeparator: String

The line separator to use. (Either "\n" or "\r\n")

Functions

print

abstract fun print(text: String, error: Boolean): Unit

Show some text to the user.

promptForLine

abstract fun promptForLine(prompt: String, hideInput: Boolean): String?

Show the prompt to the user, and return a line of their response.

Inheritors

InteractiveCliktConsole

class InteractiveCliktConsole : CliktConsole

NonInteractiveCliktConsole

class NonInteractiveCliktConsole : CliktConsole