Documentation
¶
Index ¶
- func ClearTerminal()
- func Confirm(prompt string) (bool, error)
- func ConfirmWithDefault(prompt string, defaultValue bool) (bool, error)
- func DetectPager() string
- func GetClearCommand() string
- func InputHiddenString(prompt, help string, validator func(string) error) (string, error)
- func InputString(prompt, help, defaultValue string, validator func(string) error) (string, error)
- func RunPager(pager string, content string) error
- func SelectString(prompt string, options []string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearTerminal ¶
func ClearTerminal()
ClearTerminal tries to clear the screen and scrollback buffer using cross-platform methods.
func ConfirmWithDefault ¶
ConfirmWithDefault prompts the user to confirm an action with a yes/no question and a default value.
func GetClearCommand ¶
func GetClearCommand() string
GetClearCommand returns the appropriate clear command for the current platform.
func InputHiddenString ¶
InputHiddenString prompts the user to input a string. The input is hidden from the user. The validator is used to validate the input. The help text is displayed to the user when they ask for help. There is no default value.
func InputString ¶
InputString prompts the user to input a string. The input is visible to the user. The validator is used to validate the input. The help text is displayed to the user when they ask for help. If defaultValue is not empty, it will be used as the default value.
Types ¶
This section is empty.