console

package
v2.0.21 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UsePrettyPrompts = runtime.GOOS != "windows"

Windows (powershell, cygwin, git bash) aren't propertly supported with pretty prompts (promptui or huh) So we'll use raw reads for these "dumb" terminals

Functions

func Errorln

func Errorln(format string, a ...any) error

func PrintSeparateln

func PrintSeparateln(format string, a ...any)

func Println

func Println(format string, a ...any)

Types

type Input added in v2.0.20

type Input struct {
	// contains filtered or unexported fields
}

func NewInput added in v2.0.20

func NewInput() *Input

func (*Input) Prompt added in v2.0.20

func (i *Input) Prompt(prompt string) *Input

func (*Input) Run added in v2.0.20

func (i *Input) Run() error

func (*Input) Title added in v2.0.20

func (i *Input) Title(title string) *Input

func (*Input) Validate added in v2.0.20

func (i *Input) Validate(validate func(string) error) *Input

func (*Input) Value added in v2.0.20

func (i *Input) Value(value *string) *Input

type Option added in v2.0.20

type Option[T comparable] struct {
	Title string
	Value T
}

func NewOption added in v2.0.20

func NewOption[T comparable](title string, value T) Option[T]

type Select added in v2.0.20

type Select[T comparable] struct {
	// contains filtered or unexported fields
}

func NewSelect added in v2.0.20

func NewSelect[T comparable]() *Select[T]

func (*Select[T]) Options added in v2.0.20

func (s *Select[T]) Options(optionsArray []T) *Select[T]

func (*Select[T]) Prompt added in v2.0.20

func (s *Select[T]) Prompt(prompt string) *Select[T]

func (*Select[T]) Run added in v2.0.20

func (s *Select[T]) Run() error

func (*Select[T]) Title added in v2.0.20

func (s *Select[T]) Title(title string) *Select[T]

func (*Select[T]) Value added in v2.0.20

func (s *Select[T]) Value(value *T) *Select[T]

Jump to

Keyboard shortcuts

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