Documentation ¶
Index ¶
- type Asker
- func (a *Asker) Ask(question string, validations ...Validation) (string, error)
- func (a *Asker) AskConfirm(question string) (bool, error)
- func (a *Asker) AskSecret(question string, confirm bool, validations ...Validation) (string, error)
- func (a *Asker) AskSelect(question string, items []string) (int, error)
- type Validation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Asker ¶
type Asker struct { IsVimMode bool Mask rune Stdin io.ReadCloser Stdout io.WriteCloser }
Asker is a helper for retrieving user input from the given reader
func (*Asker) Ask ¶
func (a *Asker) Ask(question string, validations ...Validation) (string, error)
Ask retrieves user input from the current Reader
func (*Asker) AskConfirm ¶
AskConfirm retrieves confirmation and attempts to parse the various way that a use might supply confirmation e.g. yes, YES, y, si, yup etc.
type Validation ¶
Validation defines a general validation processor for a given string
Click to show internal directories.
Click to hide internal directories.