Documentation
¶
Overview ¶
Code generated by generate_flags, DO NOT EDIT!
Index ¶
- Variables
- func FlagDefined(cmd *cobra.Command, name string) bool
- func GetBool(cmd *cobra.Command, name string) (out bool, err error)
- func GetBoolSlice(cmd *cobra.Command, name string) (out []bool, err error)
- func GetBytesBase64(cmd *cobra.Command, name string) (out []byte, err error)
- func GetBytesHex(cmd *cobra.Command, name string) (out []byte, err error)
- func GetCount(cmd *cobra.Command, name string) (out int, err error)
- func GetDuration(cmd *cobra.Command, name string) (out time.Duration, err error)
- func GetDurationSlice(cmd *cobra.Command, name string) (out []time.Duration, err error)
- func GetFloat32(cmd *cobra.Command, name string) (out float32, err error)
- func GetFloat32Slice(cmd *cobra.Command, name string) (out []float32, err error)
- func GetFloat64(cmd *cobra.Command, name string) (out float64, err error)
- func GetFloat64Slice(cmd *cobra.Command, name string) (out []float64, err error)
- func GetIP(cmd *cobra.Command, name string) (out net.IP, err error)
- func GetIPNet(cmd *cobra.Command, name string) (out net.IPNet, err error)
- func GetIPSlice(cmd *cobra.Command, name string) (out []net.IP, err error)
- func GetIPv4Mask(cmd *cobra.Command, name string) (out net.IPMask, err error)
- func GetInt(cmd *cobra.Command, name string) (out int, err error)
- func GetInt8(cmd *cobra.Command, name string) (out int8, err error)
- func GetInt16(cmd *cobra.Command, name string) (out int16, err error)
- func GetInt32(cmd *cobra.Command, name string) (out int32, err error)
- func GetInt32Slice(cmd *cobra.Command, name string) (out []int32, err error)
- func GetInt64(cmd *cobra.Command, name string) (out int64, err error)
- func GetInt64Slice(cmd *cobra.Command, name string) (out []int64, err error)
- func GetIntSlice(cmd *cobra.Command, name string) (out []int, err error)
- func GetString(cmd *cobra.Command, name string) (out string, err error)
- func GetStringArray(cmd *cobra.Command, name string) (out []string, err error)
- func GetStringSlice(cmd *cobra.Command, name string) (out []string, err error)
- func GetStringToInt(cmd *cobra.Command, name string) (out map[string]int, err error)
- func GetStringToInt64(cmd *cobra.Command, name string) (out map[string]int64, err error)
- func GetStringToString(cmd *cobra.Command, name string) (out map[string]string, err error)
- func GetUint(cmd *cobra.Command, name string) (out uint, err error)
- func GetUint8(cmd *cobra.Command, name string) (out uint8, err error)
- func GetUint16(cmd *cobra.Command, name string) (out uint16, err error)
- func GetUint32(cmd *cobra.Command, name string) (out uint32, err error)
- func GetUint64(cmd *cobra.Command, name string) (out uint64, err error)
- func GetUintSlice(cmd *cobra.Command, name string) (out []uint, err error)
- func MustGetBool(cmd *cobra.Command, name string) bool
- func MustGetBoolProvided(cmd *cobra.Command, name string) (bool, bool)
- func MustGetBoolSlice(cmd *cobra.Command, name string) []bool
- func MustGetBoolSliceProvided(cmd *cobra.Command, name string) ([]bool, bool)
- func MustGetBytesBase64(cmd *cobra.Command, name string) []byte
- func MustGetBytesBase64Provided(cmd *cobra.Command, name string) ([]byte, bool)
- func MustGetBytesHex(cmd *cobra.Command, name string) []byte
- func MustGetBytesHexProvided(cmd *cobra.Command, name string) ([]byte, bool)
- func MustGetCount(cmd *cobra.Command, name string) int
- func MustGetCountProvided(cmd *cobra.Command, name string) (int, bool)
- func MustGetDuration(cmd *cobra.Command, name string) time.Duration
- func MustGetDurationProvided(cmd *cobra.Command, name string) (time.Duration, bool)
- func MustGetDurationSlice(cmd *cobra.Command, name string) []time.Duration
- func MustGetDurationSliceProvided(cmd *cobra.Command, name string) ([]time.Duration, bool)
- func MustGetFloat32(cmd *cobra.Command, name string) float32
- func MustGetFloat32Provided(cmd *cobra.Command, name string) (float32, bool)
- func MustGetFloat32Slice(cmd *cobra.Command, name string) []float32
- func MustGetFloat32SliceProvided(cmd *cobra.Command, name string) ([]float32, bool)
- func MustGetFloat64(cmd *cobra.Command, name string) float64
- func MustGetFloat64Provided(cmd *cobra.Command, name string) (float64, bool)
- func MustGetFloat64Slice(cmd *cobra.Command, name string) []float64
- func MustGetFloat64SliceProvided(cmd *cobra.Command, name string) ([]float64, bool)
- func MustGetIP(cmd *cobra.Command, name string) net.IP
- func MustGetIPNet(cmd *cobra.Command, name string) net.IPNet
- func MustGetIPNetProvided(cmd *cobra.Command, name string) (net.IPNet, bool)
- func MustGetIPProvided(cmd *cobra.Command, name string) (net.IP, bool)
- func MustGetIPSlice(cmd *cobra.Command, name string) []net.IP
- func MustGetIPSliceProvided(cmd *cobra.Command, name string) ([]net.IP, bool)
- func MustGetIPv4Mask(cmd *cobra.Command, name string) net.IPMask
- func MustGetIPv4MaskProvided(cmd *cobra.Command, name string) (net.IPMask, bool)
- func MustGetInt(cmd *cobra.Command, name string) int
- func MustGetInt8(cmd *cobra.Command, name string) int8
- func MustGetInt8Provided(cmd *cobra.Command, name string) (int8, bool)
- func MustGetInt16(cmd *cobra.Command, name string) int16
- func MustGetInt16Provided(cmd *cobra.Command, name string) (int16, bool)
- func MustGetInt32(cmd *cobra.Command, name string) int32
- func MustGetInt32Provided(cmd *cobra.Command, name string) (int32, bool)
- func MustGetInt32Slice(cmd *cobra.Command, name string) []int32
- func MustGetInt32SliceProvided(cmd *cobra.Command, name string) ([]int32, bool)
- func MustGetInt64(cmd *cobra.Command, name string) int64
- func MustGetInt64Provided(cmd *cobra.Command, name string) (int64, bool)
- func MustGetInt64Slice(cmd *cobra.Command, name string) []int64
- func MustGetInt64SliceProvided(cmd *cobra.Command, name string) ([]int64, bool)
- func MustGetIntProvided(cmd *cobra.Command, name string) (int, bool)
- func MustGetIntSlice(cmd *cobra.Command, name string) []int
- func MustGetIntSliceProvided(cmd *cobra.Command, name string) ([]int, bool)
- func MustGetString(cmd *cobra.Command, name string) string
- func MustGetStringArray(cmd *cobra.Command, name string) []string
- func MustGetStringArrayProvided(cmd *cobra.Command, name string) ([]string, bool)
- func MustGetStringProvided(cmd *cobra.Command, name string) (string, bool)
- func MustGetStringSlice(cmd *cobra.Command, name string) []string
- func MustGetStringSliceProvided(cmd *cobra.Command, name string) ([]string, bool)
- func MustGetStringToInt(cmd *cobra.Command, name string) map[string]int
- func MustGetStringToInt64(cmd *cobra.Command, name string) map[string]int64
- func MustGetStringToInt64Provided(cmd *cobra.Command, name string) (map[string]int64, bool)
- func MustGetStringToIntProvided(cmd *cobra.Command, name string) (map[string]int, bool)
- func MustGetStringToString(cmd *cobra.Command, name string) map[string]string
- func MustGetStringToStringProvided(cmd *cobra.Command, name string) (map[string]string, bool)
- func MustGetUint(cmd *cobra.Command, name string) uint
- func MustGetUint8(cmd *cobra.Command, name string) uint8
- func MustGetUint8Provided(cmd *cobra.Command, name string) (uint8, bool)
- func MustGetUint16(cmd *cobra.Command, name string) uint16
- func MustGetUint16Provided(cmd *cobra.Command, name string) (uint16, bool)
- func MustGetUint32(cmd *cobra.Command, name string) uint32
- func MustGetUint32Provided(cmd *cobra.Command, name string) (uint32, bool)
- func MustGetUint64(cmd *cobra.Command, name string) uint64
- func MustGetUint64Provided(cmd *cobra.Command, name string) (uint64, bool)
- func MustGetUintProvided(cmd *cobra.Command, name string) (uint, bool)
- func MustGetUintSlice(cmd *cobra.Command, name string) []uint
- func MustGetUintSliceProvided(cmd *cobra.Command, name string) ([]uint, bool)
- func MustGetViperKey(cmd *cobra.Command, name string) string
- func MustGetViperKeyFromFlag(flag *pflag.Flag) string
- type ErrFlagNotExist
Constants ¶
This section is empty.
Variables ¶
var ErrViperTypeNotSupported = errors.New("viper type not supported")
Functions ¶
func FlagDefined ¶
FlagDefined returns `true` if the flag is defined on the `cmd` (or one of its parent) and `false` otherwise.
func GetBool ¶
GetBool returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetBool. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetBool(name)`
See [ConfigureViper] for key rebinding rules.
func GetBoolSlice ¶
GetBoolSlice returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetBoolSlice(name)`
See [ConfigureViper] for key rebinding rules.
func GetBytesBase64 ¶
GetBytesBase64 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetBytesBase64(name)`
See [ConfigureViper] for key rebinding rules.
func GetBytesHex ¶
GetBytesHex returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetBytesHex(name)`
See [ConfigureViper] for key rebinding rules.
func GetCount ¶
GetCount returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetCount(name)`
See [ConfigureViper] for key rebinding rules.
func GetDuration ¶
GetDuration returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetDuration. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetDuration(name)`
See [ConfigureViper] for key rebinding rules.
func GetDurationSlice ¶
GetDurationSlice returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetDurationSlice(name)`
See [ConfigureViper] for key rebinding rules.
func GetFloat32 ¶
GetFloat32 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetFloat64. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetFloat32(name)`
See [ConfigureViper] for key rebinding rules.
func GetFloat32Slice ¶
GetFloat32Slice returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetFloat32Slice(name)`
See [ConfigureViper] for key rebinding rules.
func GetFloat64 ¶
GetFloat64 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetFloat64. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetFloat64(name)`
See [ConfigureViper] for key rebinding rules.
func GetFloat64Slice ¶
GetFloat64Slice returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetFloat64Slice(name)`
See [ConfigureViper] for key rebinding rules.
func GetIP ¶
GetIP returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetIP(name)`
See [ConfigureViper] for key rebinding rules.
func GetIPNet ¶
GetIPNet returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetIPNet(name)`
See [ConfigureViper] for key rebinding rules.
func GetIPSlice ¶
GetIPSlice returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetIPSlice(name)`
See [ConfigureViper] for key rebinding rules.
func GetIPv4Mask ¶
GetIPv4Mask returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetIPv4Mask(name)`
See [ConfigureViper] for key rebinding rules.
func GetInt ¶
GetInt returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetInt. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetInt(name)`
See [ConfigureViper] for key rebinding rules.
func GetInt8 ¶
GetInt8 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetInt32. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetInt8(name)`
See [ConfigureViper] for key rebinding rules.
func GetInt16 ¶
GetInt16 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetInt32. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetInt16(name)`
See [ConfigureViper] for key rebinding rules.
func GetInt32 ¶
GetInt32 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetInt32. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetInt32(name)`
See [ConfigureViper] for key rebinding rules.
func GetInt32Slice ¶
GetInt32Slice returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetInt32Slice(name)`
See [ConfigureViper] for key rebinding rules.
func GetInt64 ¶
GetInt64 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetInt64. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetInt64(name)`
See [ConfigureViper] for key rebinding rules.
func GetInt64Slice ¶
GetInt64Slice returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetInt64Slice(name)`
See [ConfigureViper] for key rebinding rules.
func GetIntSlice ¶
GetIntSlice returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetIntSlice. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetIntSlice(name)`
See [ConfigureViper] for key rebinding rules.
func GetString ¶
GetString returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetString. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetString(name)`
See [ConfigureViper] for key rebinding rules.
func GetStringArray ¶
GetStringArray returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetStringSlice. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetStringArray(name)`
See [ConfigureViper] for key rebinding rules.
func GetStringSlice ¶
GetStringSlice returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetStringSlice. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetStringSlice(name)`
See [ConfigureViper] for key rebinding rules.
func GetStringToInt ¶
GetStringToInt returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetStringToInt(name)`
See [ConfigureViper] for key rebinding rules.
func GetStringToInt64 ¶
GetStringToInt64 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetStringToInt64(name)`
See [ConfigureViper] for key rebinding rules.
func GetStringToString ¶
GetStringToString returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetStringMapString. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetStringToString(name)`
See [ConfigureViper] for key rebinding rules.
func GetUint ¶
GetUint returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetUint. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetUint(name)`
See [ConfigureViper] for key rebinding rules.
func GetUint8 ¶
GetUint8 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetUint16. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetUint8(name)`
See [ConfigureViper] for key rebinding rules.
func GetUint16 ¶
GetUint16 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetUint16. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetUint16(name)`
See [ConfigureViper] for key rebinding rules.
func GetUint32 ¶
GetUint32 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetUint32. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetUint32(name)`
See [ConfigureViper] for key rebinding rules.
func GetUint64 ¶
GetUint64 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetUint64. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetUint64(name)`
See [ConfigureViper] for key rebinding rules.
func GetUintSlice ¶
GetUintSlice returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, exists with specific error.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method returns an error.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetUintSlice(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetBool ¶
MustGetBool returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetBool. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetBool(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetBoolProvided ¶
MustGetBoolProvided is exactly like MustGetBool but also return if the key was changed somewhere in the configuration stack.
func MustGetBoolSlice ¶
MustGetBoolSlice returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetBoolSlice(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetBoolSliceProvided ¶
MustGetBoolSliceProvided is exactly like MustGetBoolSlice but also return if the key was changed somewhere in the configuration stack.
func MustGetBytesBase64 ¶
MustGetBytesBase64 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetBytesBase64(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetBytesBase64Provided ¶
MustGetBytesBase64Provided is exactly like MustGetBytesBase64 but also return if the key was changed somewhere in the configuration stack.
func MustGetBytesHex ¶
MustGetBytesHex returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetBytesHex(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetBytesHexProvided ¶
MustGetBytesHexProvided is exactly like MustGetBytesHex but also return if the key was changed somewhere in the configuration stack.
func MustGetCount ¶
MustGetCount returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetCount(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetCountProvided ¶
MustGetCountProvided is exactly like MustGetCount but also return if the key was changed somewhere in the configuration stack.
func MustGetDuration ¶
MustGetDuration returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetDuration. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetDuration(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetDurationProvided ¶
MustGetDurationProvided is exactly like MustGetDuration but also return if the key was changed somewhere in the configuration stack.
func MustGetDurationSlice ¶
MustGetDurationSlice returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetDurationSlice(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetDurationSliceProvided ¶
MustGetDurationSliceProvided is exactly like MustGetDurationSlice but also return if the key was changed somewhere in the configuration stack.
func MustGetFloat32 ¶
MustGetFloat32 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetFloat64. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetFloat32(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetFloat32Provided ¶
MustGetFloat32Provided is exactly like MustGetFloat32 but also return if the key was changed somewhere in the configuration stack.
func MustGetFloat32Slice ¶
MustGetFloat32Slice returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetFloat32Slice(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetFloat32SliceProvided ¶
MustGetFloat32SliceProvided is exactly like MustGetFloat32Slice but also return if the key was changed somewhere in the configuration stack.
func MustGetFloat64 ¶
MustGetFloat64 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetFloat64. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetFloat64(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetFloat64Provided ¶
MustGetFloat64Provided is exactly like MustGetFloat64 but also return if the key was changed somewhere in the configuration stack.
func MustGetFloat64Slice ¶
MustGetFloat64Slice returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetFloat64Slice(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetFloat64SliceProvided ¶
MustGetFloat64SliceProvided is exactly like MustGetFloat64Slice but also return if the key was changed somewhere in the configuration stack.
func MustGetIP ¶
MustGetIP returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetIP(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetIPNet ¶
MustGetIPNet returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetIPNet(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetIPNetProvided ¶
MustGetIPNetProvided is exactly like MustGetIPNet but also return if the key was changed somewhere in the configuration stack.
func MustGetIPProvided ¶
MustGetIPProvided is exactly like MustGetIP but also return if the key was changed somewhere in the configuration stack.
func MustGetIPSlice ¶
MustGetIPSlice returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetIPSlice(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetIPSliceProvided ¶
MustGetIPSliceProvided is exactly like MustGetIPSlice but also return if the key was changed somewhere in the configuration stack.
func MustGetIPv4Mask ¶
MustGetIPv4Mask returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetIPv4Mask(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetIPv4MaskProvided ¶
MustGetIPv4MaskProvided is exactly like MustGetIPv4Mask but also return if the key was changed somewhere in the configuration stack.
func MustGetInt ¶
MustGetInt returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetInt. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetInt(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetInt8 ¶
MustGetInt8 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetInt32. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetInt8(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetInt8Provided ¶
MustGetInt8Provided is exactly like MustGetInt8 but also return if the key was changed somewhere in the configuration stack.
func MustGetInt16 ¶
MustGetInt16 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetInt32. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetInt16(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetInt16Provided ¶
MustGetInt16Provided is exactly like MustGetInt16 but also return if the key was changed somewhere in the configuration stack.
func MustGetInt32 ¶
MustGetInt32 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetInt32. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetInt32(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetInt32Provided ¶
MustGetInt32Provided is exactly like MustGetInt32 but also return if the key was changed somewhere in the configuration stack.
func MustGetInt32Slice ¶
MustGetInt32Slice returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetInt32Slice(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetInt32SliceProvided ¶
MustGetInt32SliceProvided is exactly like MustGetInt32Slice but also return if the key was changed somewhere in the configuration stack.
func MustGetInt64 ¶
MustGetInt64 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetInt64. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetInt64(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetInt64Provided ¶
MustGetInt64Provided is exactly like MustGetInt64 but also return if the key was changed somewhere in the configuration stack.
func MustGetInt64Slice ¶
MustGetInt64Slice returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetInt64Slice(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetInt64SliceProvided ¶
MustGetInt64SliceProvided is exactly like MustGetInt64Slice but also return if the key was changed somewhere in the configuration stack.
func MustGetIntProvided ¶
MustGetIntProvided is exactly like MustGetInt but also return if the key was changed somewhere in the configuration stack.
func MustGetIntSlice ¶
MustGetIntSlice returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetIntSlice. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetIntSlice(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetIntSliceProvided ¶
MustGetIntSliceProvided is exactly like MustGetIntSlice but also return if the key was changed somewhere in the configuration stack.
func MustGetString ¶
MustGetString returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetString. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetString(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetStringArray ¶
MustGetStringArray returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetStringSlice. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetStringArray(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetStringArrayProvided ¶
MustGetStringArrayProvided is exactly like MustGetStringArray but also return if the key was changed somewhere in the configuration stack.
func MustGetStringProvided ¶
MustGetStringProvided is exactly like MustGetString but also return if the key was changed somewhere in the configuration stack.
func MustGetStringSlice ¶
MustGetStringSlice returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetStringSlice. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetStringSlice(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetStringSliceProvided ¶
MustGetStringSliceProvided is exactly like MustGetStringSlice but also return if the key was changed somewhere in the configuration stack.
func MustGetStringToInt ¶
MustGetStringToInt returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetStringToInt(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetStringToInt64 ¶
MustGetStringToInt64 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetStringToInt64(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetStringToInt64Provided ¶
MustGetStringToInt64Provided is exactly like MustGetStringToInt64 but also return if the key was changed somewhere in the configuration stack.
func MustGetStringToIntProvided ¶
MustGetStringToIntProvided is exactly like MustGetStringToInt but also return if the key was changed somewhere in the configuration stack.
func MustGetStringToString ¶
MustGetStringToString returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetStringMapString. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetStringToString(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetStringToStringProvided ¶
MustGetStringToStringProvided is exactly like MustGetStringToString but also return if the key was changed somewhere in the configuration stack.
func MustGetUint ¶
MustGetUint returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetUint. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetUint(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetUint8 ¶
MustGetUint8 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetUint16. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetUint8(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetUint8Provided ¶
MustGetUint8Provided is exactly like MustGetUint8 but also return if the key was changed somewhere in the configuration stack.
func MustGetUint16 ¶
MustGetUint16 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetUint16. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetUint16(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetUint16Provided ¶
MustGetUint16Provided is exactly like MustGetUint16 but also return if the key was changed somewhere in the configuration stack.
func MustGetUint32 ¶
MustGetUint32 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetUint32. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetUint32(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetUint32Provided ¶
MustGetUint32Provided is exactly like MustGetUint32 but also return if the key was changed somewhere in the configuration stack.
func MustGetUint64 ¶
MustGetUint64 returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.GetUint64. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetUint64(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetUint64Provided ¶
MustGetUint64Provided is exactly like MustGetUint64 but also return if the key was changed somewhere in the configuration stack.
func MustGetUintProvided ¶
MustGetUintProvided is exactly like MustGetUint but also return if the key was changed somewhere in the configuration stack.
func MustGetUintSlice ¶
MustGetUintSlice returns the configuration value for your CLI. This method version lookup for the flag's name. If the flag is not found, prints a message and exit with process with code 1.
If the flag is found and [ConfigureViper] was used and rebound a key for it, delegate to viper.Get. Note that not all type are Viper supported, in which this method prints a message and exit with process with code 1.
Otherwise if Viper was not configured, delegates to `cmd.Flags().GetUintSlice(name)`
See [ConfigureViper] for key rebinding rules.
func MustGetUintSliceProvided ¶
MustGetUintSliceProvided is exactly like MustGetUintSlice but also return if the key was changed somewhere in the configuration stack.
func MustGetViperKey ¶
MustGetViperKey returns the viper key associated with the flag `name` on the `cmd` (or one of its parent). It panics if the flag is not defined.
You must have used `cli.ConfigureViperForCommand(cmd, prefix)` or `cli.ConfigureViper(prefix)` for this call to not panic.
func MustGetViperKeyFromFlag ¶
MustGetViperKey returns the viper key associated with the flag.
You must have used `cli.ConfigureViperForCommand(cmd, prefix)` or `cli.ConfigureViper(prefix)` for this call to not panic.
Types ¶
type ErrFlagNotExist ¶
type ErrFlagNotExist struct {
Name string
}
func (*ErrFlagNotExist) Error ¶
func (e *ErrFlagNotExist) Error() string