Documentation
¶
Overview ¶
Package questions provides interactive terminal prompting utilities.
Index ¶
- func PrintToTerm(text ...interface{})
- func PrintfToTerm(msg string, format ...interface{})
- func PrintlnToTerm(text ...interface{})
- func Prompt(text, def string) (string, error)
- func PromptBool(text string, def bool) (bool, error)
- func PromptFormattedOptions(text string, def int, options ...string) (int, error)
- func PromptOptional(text, def string) (string, error)
- func PromptOptions(text string, def int, options ...string) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintToTerm ¶
func PrintToTerm(text ...interface{})
PrintToTerm prints text to the terminal, using stderr if stdout is not a TTY.
func PrintfToTerm ¶
func PrintfToTerm(msg string, format ...interface{})
PrintfToTerm prints formatted text to the terminal, using stderr if stdout is not a TTY.
func PrintlnToTerm ¶
func PrintlnToTerm(text ...interface{})
PrintlnToTerm prints text with a newline to the terminal, using stderr if stdout is not a TTY.
func PromptBool ¶
PromptBool prompts the user for a yes/no answer and returns a boolean.
func PromptFormattedOptions ¶
PromptFormattedOptions displays numbered options and prompts the user to select one.
func PromptOptional ¶
PromptOptional displays text and reads an optional response from stdin, returning the default if empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.