Documentation
¶
Overview ¶
Package ui is the terminal prompter.
Index ¶
- type Prompter
- func (p *Prompter) Ask(question string) (string, error)
- func (p *Prompter) Confirm(question string, def bool) (bool, error)
- func (p *Prompter) Interactive() bool
- func (p *Prompter) MultiSelect(title string, options []ports.Option) ([]int, error)
- func (p *Prompter) Select(title string, options []ports.Option) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Prompter ¶
type Prompter struct {
// Lang translates the questions and labels; nil is English.
Lang *core.Language
// contains filtered or unexported fields
}
Prompter asks questions on a reader/writer pair.
func New ¶
New builds a prompter. It is interactive only when stdin is a terminal and prompting was not disabled.
func (*Prompter) Ask ¶ added in v1.7.0
Ask reads one line of free text. An empty line is an empty answer.
func (*Prompter) Interactive ¶
Interactive reports whether the human can be asked.
func (*Prompter) MultiSelect ¶
MultiSelect asks for zero or more options as a comma-separated list.