terminal

package
v0.0.0-...-f808c62 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2018 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ask

func Ask(os tbnos.OS, yesNoQ string, args ...interface{}) (bool, error)

Ask formats and prints a prompt (which should be a yes or no question) on stdout, and then waits for a line of input from stdin. The string " y/N: " is automatically appended to the prompt. After trimming whitespace and converting to lowercase, if the response is "y" or "yes", the function returns true. An error may occur reading stdin.

func Prompt

func Prompt(os tbnos.OS, prompt string, args ...interface{}) (string, error)

Prompt formats a prompt, prints it on stdout, and then waits for a line of input from stdin. The trailing CRLF or LF is not returned. If the response ends with an EOF, the characters read up to EOF are returned with the EOF error. Prompt uses unbuffered input to avoid consuming bytes intended for subsequent consumers of stdin.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL