terminal

package
v0.0.0-...-0e8a65c Latest Latest
Warning

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

Go to latest
Published: May 20, 2017 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const ESC = "\033["

Variables

View Source
var (
	YesDefintions     = []string{"y", "Y", "yes", "YES", "Yes"}
	NoDefinitions     = []string{"n", "N", "no", "NO", "No"}
	YesOrNoSuffix     = "? [Y/N]: "
	ErrProvideYesOrNo = errors.New("please answer with 'yes' or 'no'")
	ErrInvalidChoice  = errors.New("Invalid choice please type a number in range")
)
View Source
var Writer io.Writer = os.Stdout

Functions

func AskString

func AskString(question string) string

AskString asks for a string

func Choice

func Choice(question string, options []string) int

func ClearLine

func ClearLine()

func ClearScr

func ClearScr()

func ClearScreen

func ClearScreen()

func CursorDn

func CursorDn(i int)

func CursorLf

func CursorLf(i int)

func CursorRestore

func CursorRestore()

func CursorRt

func CursorRt(i int)

func CursorSave

func CursorSave()

func CursorUp

func CursorUp(i int)

func GetTerminalSize

func GetTerminalSize() (int, int, error)

func GotoXY

func GotoXY(x int, y int)

func PrintXY

func PrintXY(x int, y int, s string)

func Wait

func Wait(i int, style int)

func WaitD

func WaitD(i int)

func YesOrNo

func YesOrNo(question string, def bool) bool

YesOrNo ask a question that can be answered by yes or no

Types

type Dialog

type Dialog struct {
}

Jump to

Keyboard shortcuts

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