Documentation
¶
Index ¶
- func ColorText(text string, color *color.Color) string
- func GetArg(cmd *cobra.Command, key string, prompt string, existingVal string, hidden bool, ...) (string, error)
- func GetBoolArg(cmd *cobra.Command, key, prompt string, existingVal *bool, ...) (bool, error)
- func GetCheckboxArgs(cmd *cobra.Command, keys []string, prompt string, possibleVals []string, ...) ([]string, error)
- func GetSwitchArg(cmd *cobra.Command, key, prompt string, possibleVals []string, ...) (string, error)
- func PrintColored(text any, color *color.Color)
- func PrintFailure(text any)
- func PrintNormal(text any)
- func PrintNormalBright(text any)
- func PrintSuccess(text any)
- func PrintSuccessBright(text any)
- func PrintWarning(text any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetArg ¶
func GetArg(cmd *cobra.Command, key string, prompt string, existingVal string, hidden bool, prioritizeExistingVal bool, emptyValueAllowed bool) (string, error)
GetArg retrieves the value of a command-line argument from the command flags or prompts the user for input if not provided.
func GetBoolArg ¶
func GetBoolArg(cmd *cobra.Command, key, prompt string, existingVal *bool, prioritizeExistingVal bool) (bool, error)
GetBoolArg retrieves a boolean argument from the command flags or prompts the user for input if not provided.
func GetCheckboxArgs ¶
func GetCheckboxArgs(cmd *cobra.Command, keys []string, prompt string, possibleVals []string, existingVals map[string]string, prioritizeExistingVal bool) ([]string, error)
GetCheckboxArgs retrieves checkbox arguments from the command flags or prompts the user for input if not provided.
func GetSwitchArg ¶
func GetSwitchArg(cmd *cobra.Command, key, prompt string, possibleVals []string, existingVal string, prioritizeExistingVal bool) (string, error)
GetSwitchArg retrieves a switch argument from the command flags or prompts the user for input if not provided.
func PrintColored ¶
PrintColored prints the given text in the specified color to stdout.
func PrintFailure ¶
func PrintFailure(text any)
PrintFailure prints the given text in red color to stdout.
func PrintNormal ¶
func PrintNormal(text any)
PrintNormal prints the given text in default color to stdout.
func PrintNormalBright ¶
func PrintNormalBright(text any)
PrintNormalBright prints the given text in bright color to stdout.
func PrintSuccess ¶
func PrintSuccess(text any)
PrintSuccess prints the given text in green color to stdout.
func PrintSuccessBright ¶
func PrintSuccessBright(text any)
PrintSuccessBright prints the given text in bright green color to stdout.
func PrintWarning ¶
func PrintWarning(text any)
PrintWarning prints the given text in yellow color to stdout.
Types ¶
This section is empty.