args

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorText

func ColorText(text string, color *color.Color) string

ColorText colors the given text using the specified color.

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

func PrintColored(text any, color *color.Color)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL