Documentation
¶
Index ¶
- Constants
- Variables
- func ClearScreen()
- func Confirm(prompt string) (bool, error)
- func PrintBanner(version, provider string)
- func PrintDefault(msg string)
- func PrintError(msg string)
- func PrintGray(msg string)
- func PrintHeader(msg string)
- func PrintInfo(msg string)
- func PrintProviderOption(number int, name string, cfg *config.Config, secrets map[string]string, ...)
- func PrintSection(msg string)
- func PrintSuccess(msg string)
- func PrintWarn(msg string)
- func PrintWhite(msg string)
- func Prompt(prompt string) (string, error)
- func PromptSecret(prompt string) (string, error)
- func PromptWithDefault(prompt, defaultVal string) (string, error)
Constants ¶
const ( Green = "\033[0;32m" Yellow = "\033[0;33m" Red = "\033[0;31m" Blue = "\033[0;34m" White = "\033[0;37m" Gray = "\033[0;90m" Bold = "\033[1m" Reset = "\033[0m" )
Variables ¶
var ErrUserCancelled = errors.New("user cancelled input")
ErrUserCancelled is returned when the user cancels input (Ctrl+C or Ctrl+D)
Functions ¶
func ClearScreen ¶ added in v1.8.0
func ClearScreen()
ClearScreen clears the terminal screen using the appropriate command for the platform.
func Confirm ¶ added in v1.5.0
Confirm prompts the user for a yes/no confirmation. Returns true if the user answers yes/y (case-insensitive), false otherwise.
func PrintBanner ¶
func PrintBanner(version, provider string)
func PrintDefault ¶ added in v0.3.0
func PrintDefault(msg string)
PrintDefault prints provider name with "(default)" indicator in gray
func PrintError ¶
func PrintError(msg string)
func PrintHeader ¶
func PrintHeader(msg string)
func PrintProviderOption ¶
func PrintSection ¶
func PrintSection(msg string)
func PrintSuccess ¶
func PrintSuccess(msg string)
func PrintWhite ¶ added in v0.3.0
func PrintWhite(msg string)
PrintWhite prints a message in white (no color)
func Prompt ¶
Prompt prompts the user for input and returns the input string. Returns empty string and ErrUserCancelled if input cannot be read.
func PromptSecret ¶
func PromptWithDefault ¶
PromptWithDefault prompts the user for input with a default value. Returns the default value and ErrUserCancelled if input cannot be read.
Types ¶
This section is empty.