Documentation
¶
Index ¶
- func BindFlagsAndEnvToViper(cmd *cobra.Command, params any) (err error)
- func ConfigureViper(configFilePath string, applicationName string, verbose bool, ...)
- func GetOpenCommand(args ...string) (string, []string)
- func LogUnableToMarkFlagAsRequired(flagName string, err error)
- func OpenInBrowser(url string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindFlagsAndEnvToViper ¶ added in v0.0.69
/ BindFlagsAndEnvToViper binds the flags and environment variables to viper / / Example: / type config struct { / Param1 string `mapstructure:"param1" structs:"param1" env:"PARAM1"` / } / / func init() { / rootCmd.AddCommand(listCmd) / flags := listCmd.Flags() / flags.StringVar(&listOpts.format, "format", "Format") / cli.BindFlagsAndEnvToViper(listCmd, listOpts) / }
func ConfigureViper ¶ added in v0.0.46
func GetOpenCommand ¶
GetOpenCommand returns the command and its required arguments according to the current operation system
func LogUnableToMarkFlagAsRequired ¶ added in v0.0.88
LogUnableToMarkFlagAsRequired logs an error when unable to mark a flag as required
func OpenInBrowser ¶ added in v0.0.45
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.