terminal

package
v0.6.321 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package terminal is for terminal outputting

Index

Constants

This section is empty.

Variables

View Source
var ProgressBarMax = 100

Functions

func DisplayBrevLogo(t *Terminal)

func PromptGetInput added in v0.4.0

func PromptGetInput(pc PromptContent) string

func PromptSelectInput added in v0.4.0

func PromptSelectInput(pc PromptSelectContent) string

Types

type Confirmer added in v0.6.318

type Confirmer interface {
	ConfirmYesNo(label string) bool
}

Confirmer prompts for yes/no confirmation.

type ProgressBar

type ProgressBar struct {
	Bar            *progressbar.ProgressBar
	CurrPercentage int
}

type PromptContent added in v0.4.0

type PromptContent struct {
	ErrorMsg   string
	Label      string
	Default    string
	AllowEmpty bool
	Mask       rune
}

type PromptSelectContent added in v0.4.0

type PromptSelectContent struct {
	ErrorMsg string
	Label    string
	Items    []string
}

type Selector added in v0.6.318

type Selector interface {
	Select(label string, items []string) string
}

Selector prompts the user to choose from a list of items.

type Terminal

type Terminal struct {
	Green    func(format string, a ...interface{}) string
	Yellow   func(format string, a ...interface{}) string
	Red      func(format string, a ...interface{}) string
	Blue     func(format string, a ...interface{}) string
	White    func(format string, a ...interface{}) string
	BoldBlue func(format string, a ...interface{}) string

	Bar ProgressBar

	Spinner *spinner.Spinner
	// contains filtered or unexported fields
}

func New

func New() (t *Terminal)

func (*Terminal) Eprint

func (t *Terminal) Eprint(a string)

func (*Terminal) Eprintf

func (t *Terminal) Eprintf(format string, a ...interface{})

func (*Terminal) Errprint

func (t *Terminal) Errprint(err error, a string)

func (*Terminal) NewSpinner added in v0.3.0

func (t *Terminal) NewSpinner() *spinner.Spinner

func (*Terminal) Print

func (t *Terminal) Print(a string)

Explicit error handling for Print functions

func (*Terminal) Vprint

func (t *Terminal) Vprint(a string)

func (*Terminal) Vprintf

func (t *Terminal) Vprintf(format string, a ...interface{})

Jump to

Keyboard shortcuts

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