Documentation ¶
Overview ¶
Package console contains utility functions for working with text consoles
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Blue = wrap(color.New(color.Blue))
Blue returns the input as a string of blue-coloured text if the console supports colours
var Bold = wrap(color.New(color.Bold))
Bold returns the input as a string of bold text if the console supports colours
var Cyan = wrap(color.New(color.Cyan))
Cyan returns the input as a string of cyan-coloured text if the console supports colours
var Green = wrap(color.New(color.Green))
Green returns the input as a string of green-coloured text if the console supports colours
var Grey = wrap(color.New(color.Gray))
Grey returns the input as a string of grey-coloured text if the console supports colours
var IsTTY bool
IsTTY will be true if stdout is connected to a true terminal
var NoColour = false
NoColour should be false if you want output to be coloured
var Plain = wrap(color.New(color.Normal))
Plain returns the input as a string of normal-coloured text if the console supports colours
var Red = wrap(color.New(color.LightRed))
Red returns the input as a string of red-coloured text if the console supports colours
White returns the input as a string of white-coloured text if the console supports colours
var Yellow = wrap(color.New(color.Yellow))
Yellow returns the input as a string of yellow-coloured text if the console supports colours
Functions ¶
func Ask ¶
Ask prints the supplied prompt and then waits for user input which is returned as a string.
func ClearLine ¶
func ClearLine()
ClearLine removes all text from the current line and puts the cursor on the left
func ClearLines ¶
func ClearLines(n int)
ClearLines removes all text from the previous n lines (starting with the current line) and puts the cursor on the left
func Confirm ¶
Confirm asks the user for "y" or "n" and returns true if the response was "y". defaultYes is used to determine whether (y/N) or (Y/n) is displayed after the prompt.
func CountLines ¶
CountLines returns the number of lines that would be taken up by the given string
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package run contains utility functions for executing external commands
|
Package run contains utility functions for executing external commands |
Package spinner contains functions for displaying progress updates with a spinning icon that shows the user that progress is being made.
|
Package spinner contains functions for displaying progress updates with a spinning icon that shows the user that progress is being made. |