Documentation
¶
Index ¶
- Constants
- func DisplayNumberedList(items []string)
- func DisplayNumberedListWithDescriptions(options []NumericPromptOption)
- func PromptForConfirmation(prompt string) bool
- func PromptForSelection(options []string, prompt string) (int, bool)
- func PromptForSelectionWithOptions(options []NumericPromptOption, prompt string) (int, bool)
- type NumericPromptOption
Constants ¶
View Source
const (
DefaultPrompt = "Enter option number (or 0 to cancel): "
)
Variables ¶
This section is empty.
Functions ¶
func DisplayNumberedList ¶
func DisplayNumberedList(items []string)
DisplayNumberedList displays a numbered list of options
func DisplayNumberedListWithDescriptions ¶
func DisplayNumberedListWithDescriptions(options []NumericPromptOption)
DisplayNumberedListWithDescriptions displays a numbered list with descriptions
func PromptForConfirmation ¶
PromptForConfirmation prompts the user for yes/no confirmation Supports y, yes, Y, YES (yes) and anything else (no)
func PromptForSelection ¶
PromptForSelection prompts the user to select from a numbered list of options Returns the 1-based index of the selected option, or 0 if cancelled, and ok=true if valid
func PromptForSelectionWithOptions ¶
func PromptForSelectionWithOptions(options []NumericPromptOption, prompt string) (int, bool)
PromptForSelectionWithOptions prompts user to select from typed options
Types ¶
Click to show internal directories.
Click to hide internal directories.