cli

package
v0.0.96 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 10 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindFlagsAndEnvToViper added in v0.0.69

func BindFlagsAndEnvToViper(cmd *cobra.Command, params any) (err error)

/ 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 ConfigureViper(configFilePath string, applicationName string, verbose bool, environmentVariablePrefix string)

func GetOpenCommand

func GetOpenCommand(args ...string) (string, []string)

GetOpenCommand returns the command and its required arguments according to the current operation system

func LogUnableToMarkFlagAsRequired added in v0.0.88

func LogUnableToMarkFlagAsRequired(flagName string, err error)

LogUnableToMarkFlagAsRequired logs an error when unable to mark a flag as required

func OpenInBrowser added in v0.0.45

func OpenInBrowser(url string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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