menu

package module
v0.0.0-...-41dfbe5 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: MIT Imports: 10 Imported by: 2

README

menu

Console menu

Documentation

Index

Constants

View Source
const (
	SELECT = "Select" // for Prompt()
	MARK   = "("      // default option selected rune
	BUG    = "Ж"
	GT     = ">"
	MARKED = -1
	ITEM   = -2
	EXIT   = "\x00"
)

Variables

View Source
var (
	Std = os.Stderr
)

Functions

func BugGtOut

func BugGtOut() (bug string, gt string, std io.Writer)

get color dependents

func IsAnsi

func IsAnsi() (ok bool)
func Menu(def rune,
	keyEnter,
	exitOnTypo bool,
	items ...MenuFunc,
)

Console menu

func NoColor

func NoColor() bool

no color need

func PressAnyKey

func PressAnyKey(s string, d time.Duration)

func Prompt

func Prompt(int, rune) string

helper for prompt `Select`

Types

type MenuFunc func(int, rune) string

type Static

type Static string

func (Static) Prompt

func (s Static) Prompt(int, rune) string

helper for static prompt

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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