Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCancelled = errors.New("selection cancelled")
ErrCancelled is returned by FromList when the user aborts the picker.
Functions ¶
func FromList ¶
FromList renders an interactive single-choice list and returns the index of the chosen item, or ErrCancelled if the user aborts. It renders to stderr so it does not pollute stdout. Callers must ensure they are attached to an interactive terminal (e.g. term.IsTerminal(os.Stdin.Fd())) before calling.
Types ¶
Click to show internal directories.
Click to hide internal directories.