Documentation ¶
Index ¶
- func CancelProgressBars()
- func Clear()
- func Error(format string, a ...any)
- func Input(prompt string, required bool, defaultValue string, validators ...Validator) string
- func MultiSelect(msg string, options []string, selected []int) []bool
- func Output() io.Writer
- func Print(format string, a ...any)
- func PrintColor(color Color, format string, a ...any)
- func Progress(key, message string, current, total int64, unit Unit)
- func ResetColor()
- func Select(msg string, options []string) int
- func SelectString(msg string, options map[string]string) string
- func SetColor(color Color)
- func Success(format string, a ...any)
- func Warn(format string, a ...any)
- func YesNo(question string, defaultValue bool) (yes bool)
- type Color
- type Unit
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CancelProgressBars ¶
func CancelProgressBars()
func MultiSelect ¶
MultiSelect asks the user to select an arbitrary amount of options. It returns a boolean slice of length options with the chosen indices set to true.
func PrintColor ¶
func ResetColor ¶
func ResetColor()
func SelectString ¶
SelectString asks the user to select on option. It returns the value in options of the chosen key. It panics if the length of displayOptions differs from the length of options.
Types ¶
type Color ¶
type Color string
const ( Reset Color = "\x1b[0m" Black Color = "\x1b[30m" Red Color = "\x1b[31m" Green Color = "\x1b[32m" Yellow Color = "\x1b[33m" Blue Color = "\x1b[34m" Magenta Color = "\x1b[35m" Cyan Color = "\x1b[36m" White Color = "\x1b[37m" BlackBold Color = "\x1b[1;30m" RedBold Color = "\x1b[1;31m" GreenBold Color = "\x1b[1;32m" YellowBold Color = "\x1b[1;33m" BlueBold Color = "\x1b[1;34m" MagentaBold Color = "\x1b[1;35m" CyanBold Color = "\x1b[1;36m" WhiteBold Color = "\x1b[1;37m" WhiteDim Color = "\x1b[2;37m" )
Click to show internal directories.
Click to hide internal directories.