public 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.
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getLineSeparator()
The line separator to use. (Either "\n" or "\r\n")
|
void |
print(java.lang.String text,
boolean error)
Show some text to the user.
|
java.lang.String |
promptForLine(java.lang.String prompt,
boolean hideInput)
Show the prompt to the user, and return a line of their response.
|
java.lang.String promptForLine(java.lang.String prompt, boolean hideInput)
Show the prompt to the user, and return a line of their response.
This function will block until a line of input has been read.
prompt
- The text to display to the userhideInput
- If true, the user's input should not be echoed to the screen. If the current console
does not support hidden input, this argument may be ignored..void print(java.lang.String text, boolean error)
Show some text to the user.
text
- The text to display. May or may not contain a tailing newline.error
- If true, the text is an error message, and should be printed in an alternate stream or
format, if applicable.java.lang.String getLineSeparator()
The line separator to use. (Either "\n" or "\r\n")