out

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bug

func Bug(debug string)

Bug prints the string to a newline.

func EnterKey added in v0.1.0

func EnterKey() byte

EnterKey returns the Enter keyboard code.

func ErrAppend added in v0.0.8

func ErrAppend(err error)

ErrAppend prints the error to an active line.

func ErrCont

func ErrCont(err error)

ErrCont prints the error.

func ErrFatal

func ErrFatal(err error)

ErrFatal prints the error and exits the program.

func Example

func Example(cmd string)

Example is intended for help screens and prints the example command.

func Prompt added in v0.1.0

func Prompt(question string) string

Prompt prints the question to stdout and prompts for a string reply. The prompt will loop until Enter key or Ctrl-C are pressed.

func RMLine added in v0.0.9

func RMLine() string

func Response

func Response(s string, quiet bool)

Response prints the string when quiet is false.

func Status added in v0.0.9

func Status(count, total int, m Mode) string

Status prints out the current file or item processing count.

func YN

func YN(question string, recommend YND) bool

YN prints the question to stdout and prompts for a yes or no reply. The prompt will loop unless a y or n value is given or Ctrl-C is pressed.

Types

type Mode added in v0.0.9

type Mode uint

Mode for the current processing count.

const (
	// Check returns Checking items.
	Check Mode = iota
	// Look returns Looking up items.
	Look
	// Scan returns Scanning files.
	Scan
	// Read returns Reading items.
	Read

	// ANSI control code to erase the active terminal line.
	EraseLine = "\u001b[2K"
)

type YND added in v0.1.0

type YND uint

YND is the YN default value to use when there is no input given.

const (
	// Nil does not set a default value.
	Nil YND = iota
	// Yes sets the default value.
	Yes
	// No sets the default value.
	No
)

Jump to

Keyboard shortcuts

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