Documentation
¶
Overview ¶
Package goprompt is a collection of common command line prompts for interactive programs. Each prompts comes with sensible defaults, re-mappable key bindings and many opportunities for heavy customization.
The actual prompt components can be found in the sub directories.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAborted = fmt.Errorf("prompt aborted")
ErrAborted is returned when the prompt was aborted.
Functions ¶
func UtilFuncMap ¶
UtilFuncMap returns a template.FuncMap with handy utility functions for prompt templates.
- Repeat(string, int) string: Identical to strings.Repeat.
- Len(string): reflow/ansi.PrintableRuneWidth, Len works like len but is aware of ansi codes and returns the length of the string as it appears on the screen.
- Min(int, int) int: The minimum of two ints.
- Max(int, int) int: The maximum of two ints.
- Add(int, int) int: The sum of two ints.
- Sub(int, int) int: The difference of two ints.
- Mul(int, int) int: The product of two ints.
Types ¶
Directories
¶
Path | Synopsis |
---|---|
Package confirmation implements prompt for a binary confirmation such as a yes/no question.
|
Package confirmation implements prompt for a binary confirmation such as a yes/no question. |
Package selection implements a selection prompt that allows users to select one of the pre-defined choices.
|
Package selection implements a selection prompt that allows users to select one of the pre-defined choices. |
Package selection implements a selection prompt that allows users to select one of the pre-defined choices.
|
Package selection implements a selection prompt that allows users to select one of the pre-defined choices. |
Package test contains helper functions for prompt tests.
|
Package test contains helper functions for prompt tests. |
Package textinput implements prompt for a string input that can also be used for secret strings such as passwords.
|
Package textinput implements prompt for a string input that can also be used for secret strings such as passwords. |
Click to show internal directories.
Click to hide internal directories.