Documentation
¶
Overview ¶
This package is a simple cobra/viper-aware flag wrapper that creates a unified interface for flag addition and access. It supports only the types that iscenv needs, if you need more add them.
Index ¶
- func AddConfigFlag(cmd *cobra.Command, name string, value interface{}, usage string)
- func AddConfigFlagP(cmd *cobra.Command, name string, shorthand string, value interface{}, ...)
- func AddFlag(cmd *cobra.Command, name string, value interface{}, usage string)
- func AddFlagComplex(cmd *cobra.Command, persistent bool, cfg bool, name string, shorthand string, ...)
- func AddFlagP(cmd *cobra.Command, name string, shorthand string, value interface{}, ...)
- func GetBool(cmd *cobra.Command, name string) bool
- func GetFlagKey(cmd *cobra.Command, name string) string
- func GetInt(cmd *cobra.Command, name string) int
- func GetInt64(cmd *cobra.Command, name string) int64
- func GetKeys() []string
- func GetRawValue(key string) interface{}
- func GetString(cmd *cobra.Command, name string) string
- func GetStringSlice(cmd *cobra.Command, name string) []string
- func GetUint(cmd *cobra.Command, name string) uint
- func GetValue(cmd *cobra.Command, name string) interface{}
- func GetValueWithKey(key string) interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddConfigFlag ¶
func AddConfigFlagP ¶
func AddFlagComplex ¶
func AddFlagComplex(cmd *cobra.Command, persistent bool, cfg bool, name string, shorthand string, value interface{}, usage string)
Add a flag to the provided cobra command. The default value will determine the type of flag. Supported types are: string, bool, int64, uint, []string
func GetRawValue ¶
func GetRawValue(key string) interface{}
func GetValueWithKey ¶
func GetValueWithKey(key string) interface{}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.