console

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package console contains utility functions for working with text consoles

Index

Constants

This section is empty.

Variables

View Source
var HasColour bool

HasColour is true if your program is running a platform that supports ANSI colours

View Source
var IsTTY bool

IsTTY will be true if stdout is connected to a true terminal

Functions

func Ask

func Ask(prompt string) string

Ask prints the supplied prompt and then waits for user input which is returned as a string.

func Clear

func Clear(content string)

Clear removes all text from the console and puts the cursor in the top-left corner

func ClearLine

func ClearLine()

ClearLine removes all text from the current line and puts the cursor on the left

func Confirm

func Confirm(defaultYes bool, prompt string) bool

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.

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.
Package text defines the Text type that is used to represent blocks of ANSI formatted text.
Package text defines the Text type that is used to represent blocks of ANSI formatted text.

Jump to

Keyboard shortcuts

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