sflags

package
v0.0.0-...-de7760a Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Code generated by generate_flags, DO NOT EDIT!

Index

Constants

This section is empty.

Variables

View Source
var ErrViperTypeNotSupported = errors.New("viper type not supported")

Functions

func FlagDefined

func FlagDefined(cmd *cobra.Command, name string) bool

FlagDefined returns `true` if the flag is defined on the `cmd` (or one of its parent) and `false` otherwise.

func GetBool

func GetBool(cmd *cobra.Command, name string) (out bool, err error)

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

func GetBoolSlice(cmd *cobra.Command, name string) (out []bool, err error)

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

func GetBytesBase64(cmd *cobra.Command, name string) (out []byte, err error)

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

func GetBytesHex(cmd *cobra.Command, name string) (out []byte, err error)

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

func GetCount(cmd *cobra.Command, name string) (out int, err error)

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

func GetDuration(cmd *cobra.Command, name string) (out time.Duration, err error)

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

func GetDurationSlice(cmd *cobra.Command, name string) (out []time.Duration, err error)

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

func GetFloat32(cmd *cobra.Command, name string) (out float32, err error)

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

func GetFloat32Slice(cmd *cobra.Command, name string) (out []float32, err error)

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

func GetFloat64(cmd *cobra.Command, name string) (out float64, err error)

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

func GetFloat64Slice(cmd *cobra.Command, name string) (out []float64, err error)

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

func GetIP(cmd *cobra.Command, name string) (out net.IP, err error)

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

func GetIPNet(cmd *cobra.Command, name string) (out net.IPNet, err error)

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

func GetIPSlice(cmd *cobra.Command, name string) (out []net.IP, err error)

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

func GetIPv4Mask(cmd *cobra.Command, name string) (out net.IPMask, err error)

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

func GetInt(cmd *cobra.Command, name string) (out int, err error)

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

func GetInt8(cmd *cobra.Command, name string) (out int8, err error)

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

func GetInt16(cmd *cobra.Command, name string) (out int16, err error)

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

func GetInt32(cmd *cobra.Command, name string) (out int32, err error)

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

func GetInt32Slice(cmd *cobra.Command, name string) (out []int32, err error)

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

func GetInt64(cmd *cobra.Command, name string) (out int64, err error)

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

func GetInt64Slice(cmd *cobra.Command, name string) (out []int64, err error)

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

func GetIntSlice(cmd *cobra.Command, name string) (out []int, err error)

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

func GetString(cmd *cobra.Command, name string) (out string, err error)

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

func GetStringArray(cmd *cobra.Command, name string) (out []string, err error)

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

func GetStringSlice(cmd *cobra.Command, name string) (out []string, err error)

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

func GetStringToInt(cmd *cobra.Command, name string) (out map[string]int, err error)

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

func GetStringToInt64(cmd *cobra.Command, name string) (out map[string]int64, err error)

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

func GetStringToString(cmd *cobra.Command, name string) (out map[string]string, err error)

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

func GetUint(cmd *cobra.Command, name string) (out uint, err error)

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

func GetUint8(cmd *cobra.Command, name string) (out uint8, err error)

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

func GetUint16(cmd *cobra.Command, name string) (out uint16, err error)

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

func GetUint32(cmd *cobra.Command, name string) (out uint32, err error)

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

func GetUint64(cmd *cobra.Command, name string) (out uint64, err error)

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

func GetUintSlice(cmd *cobra.Command, name string) (out []uint, err error)

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

func MustGetBool(cmd *cobra.Command, name string) bool

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

func MustGetBoolProvided(cmd *cobra.Command, name string) (bool, bool)

MustGetBoolProvided is exactly like MustGetBool but also return if the key was changed somewhere in the configuration stack.

func MustGetBoolSlice

func MustGetBoolSlice(cmd *cobra.Command, name string) []bool

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

func MustGetBoolSliceProvided(cmd *cobra.Command, name string) ([]bool, bool)

MustGetBoolSliceProvided is exactly like MustGetBoolSlice but also return if the key was changed somewhere in the configuration stack.

func MustGetBytesBase64

func MustGetBytesBase64(cmd *cobra.Command, name string) []byte

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

func MustGetBytesBase64Provided(cmd *cobra.Command, name string) ([]byte, bool)

MustGetBytesBase64Provided is exactly like MustGetBytesBase64 but also return if the key was changed somewhere in the configuration stack.

func MustGetBytesHex

func MustGetBytesHex(cmd *cobra.Command, name string) []byte

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

func MustGetBytesHexProvided(cmd *cobra.Command, name string) ([]byte, bool)

MustGetBytesHexProvided is exactly like MustGetBytesHex but also return if the key was changed somewhere in the configuration stack.

func MustGetCount

func MustGetCount(cmd *cobra.Command, name string) int

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

func MustGetCountProvided(cmd *cobra.Command, name string) (int, bool)

MustGetCountProvided is exactly like MustGetCount but also return if the key was changed somewhere in the configuration stack.

func MustGetDuration

func MustGetDuration(cmd *cobra.Command, name string) time.Duration

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

func MustGetDurationProvided(cmd *cobra.Command, name string) (time.Duration, bool)

MustGetDurationProvided is exactly like MustGetDuration but also return if the key was changed somewhere in the configuration stack.

func MustGetDurationSlice

func MustGetDurationSlice(cmd *cobra.Command, name string) []time.Duration

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

func MustGetDurationSliceProvided(cmd *cobra.Command, name string) ([]time.Duration, bool)

MustGetDurationSliceProvided is exactly like MustGetDurationSlice but also return if the key was changed somewhere in the configuration stack.

func MustGetFloat32

func MustGetFloat32(cmd *cobra.Command, name string) float32

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

func MustGetFloat32Provided(cmd *cobra.Command, name string) (float32, bool)

MustGetFloat32Provided is exactly like MustGetFloat32 but also return if the key was changed somewhere in the configuration stack.

func MustGetFloat32Slice

func MustGetFloat32Slice(cmd *cobra.Command, name string) []float32

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

func MustGetFloat32SliceProvided(cmd *cobra.Command, name string) ([]float32, bool)

MustGetFloat32SliceProvided is exactly like MustGetFloat32Slice but also return if the key was changed somewhere in the configuration stack.

func MustGetFloat64

func MustGetFloat64(cmd *cobra.Command, name string) float64

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

func MustGetFloat64Provided(cmd *cobra.Command, name string) (float64, bool)

MustGetFloat64Provided is exactly like MustGetFloat64 but also return if the key was changed somewhere in the configuration stack.

func MustGetFloat64Slice

func MustGetFloat64Slice(cmd *cobra.Command, name string) []float64

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

func MustGetFloat64SliceProvided(cmd *cobra.Command, name string) ([]float64, bool)

MustGetFloat64SliceProvided is exactly like MustGetFloat64Slice but also return if the key was changed somewhere in the configuration stack.

func MustGetIP

func MustGetIP(cmd *cobra.Command, name string) net.IP

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

func MustGetIPNet(cmd *cobra.Command, name string) net.IPNet

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

func MustGetIPNetProvided(cmd *cobra.Command, name string) (net.IPNet, bool)

MustGetIPNetProvided is exactly like MustGetIPNet but also return if the key was changed somewhere in the configuration stack.

func MustGetIPProvided

func MustGetIPProvided(cmd *cobra.Command, name string) (net.IP, bool)

MustGetIPProvided is exactly like MustGetIP but also return if the key was changed somewhere in the configuration stack.

func MustGetIPSlice

func MustGetIPSlice(cmd *cobra.Command, name string) []net.IP

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

func MustGetIPSliceProvided(cmd *cobra.Command, name string) ([]net.IP, bool)

MustGetIPSliceProvided is exactly like MustGetIPSlice but also return if the key was changed somewhere in the configuration stack.

func MustGetIPv4Mask

func MustGetIPv4Mask(cmd *cobra.Command, name string) net.IPMask

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

func MustGetIPv4MaskProvided(cmd *cobra.Command, name string) (net.IPMask, bool)

MustGetIPv4MaskProvided is exactly like MustGetIPv4Mask but also return if the key was changed somewhere in the configuration stack.

func MustGetInt

func MustGetInt(cmd *cobra.Command, name string) int

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

func MustGetInt8(cmd *cobra.Command, name string) int8

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

func MustGetInt8Provided(cmd *cobra.Command, name string) (int8, bool)

MustGetInt8Provided is exactly like MustGetInt8 but also return if the key was changed somewhere in the configuration stack.

func MustGetInt16

func MustGetInt16(cmd *cobra.Command, name string) int16

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

func MustGetInt16Provided(cmd *cobra.Command, name string) (int16, bool)

MustGetInt16Provided is exactly like MustGetInt16 but also return if the key was changed somewhere in the configuration stack.

func MustGetInt32

func MustGetInt32(cmd *cobra.Command, name string) int32

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

func MustGetInt32Provided(cmd *cobra.Command, name string) (int32, bool)

MustGetInt32Provided is exactly like MustGetInt32 but also return if the key was changed somewhere in the configuration stack.

func MustGetInt32Slice

func MustGetInt32Slice(cmd *cobra.Command, name string) []int32

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

func MustGetInt32SliceProvided(cmd *cobra.Command, name string) ([]int32, bool)

MustGetInt32SliceProvided is exactly like MustGetInt32Slice but also return if the key was changed somewhere in the configuration stack.

func MustGetInt64

func MustGetInt64(cmd *cobra.Command, name string) int64

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

func MustGetInt64Provided(cmd *cobra.Command, name string) (int64, bool)

MustGetInt64Provided is exactly like MustGetInt64 but also return if the key was changed somewhere in the configuration stack.

func MustGetInt64Slice

func MustGetInt64Slice(cmd *cobra.Command, name string) []int64

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

func MustGetInt64SliceProvided(cmd *cobra.Command, name string) ([]int64, bool)

MustGetInt64SliceProvided is exactly like MustGetInt64Slice but also return if the key was changed somewhere in the configuration stack.

func MustGetIntProvided

func MustGetIntProvided(cmd *cobra.Command, name string) (int, bool)

MustGetIntProvided is exactly like MustGetInt but also return if the key was changed somewhere in the configuration stack.

func MustGetIntSlice

func MustGetIntSlice(cmd *cobra.Command, name string) []int

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

func MustGetIntSliceProvided(cmd *cobra.Command, name string) ([]int, bool)

MustGetIntSliceProvided is exactly like MustGetIntSlice but also return if the key was changed somewhere in the configuration stack.

func MustGetString

func MustGetString(cmd *cobra.Command, name string) string

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

func MustGetStringArray(cmd *cobra.Command, name string) []string

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

func MustGetStringArrayProvided(cmd *cobra.Command, name string) ([]string, bool)

MustGetStringArrayProvided is exactly like MustGetStringArray but also return if the key was changed somewhere in the configuration stack.

func MustGetStringProvided

func MustGetStringProvided(cmd *cobra.Command, name string) (string, bool)

MustGetStringProvided is exactly like MustGetString but also return if the key was changed somewhere in the configuration stack.

func MustGetStringSlice

func MustGetStringSlice(cmd *cobra.Command, name string) []string

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

func MustGetStringSliceProvided(cmd *cobra.Command, name string) ([]string, bool)

MustGetStringSliceProvided is exactly like MustGetStringSlice but also return if the key was changed somewhere in the configuration stack.

func MustGetStringToInt

func MustGetStringToInt(cmd *cobra.Command, name string) map[string]int

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

func MustGetStringToInt64(cmd *cobra.Command, name string) map[string]int64

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

func MustGetStringToInt64Provided(cmd *cobra.Command, name string) (map[string]int64, bool)

MustGetStringToInt64Provided is exactly like MustGetStringToInt64 but also return if the key was changed somewhere in the configuration stack.

func MustGetStringToIntProvided

func MustGetStringToIntProvided(cmd *cobra.Command, name string) (map[string]int, bool)

MustGetStringToIntProvided is exactly like MustGetStringToInt but also return if the key was changed somewhere in the configuration stack.

func MustGetStringToString

func MustGetStringToString(cmd *cobra.Command, name string) map[string]string

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

func MustGetStringToStringProvided(cmd *cobra.Command, name string) (map[string]string, bool)

MustGetStringToStringProvided is exactly like MustGetStringToString but also return if the key was changed somewhere in the configuration stack.

func MustGetUint

func MustGetUint(cmd *cobra.Command, name string) uint

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

func MustGetUint8(cmd *cobra.Command, name string) uint8

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

func MustGetUint8Provided(cmd *cobra.Command, name string) (uint8, bool)

MustGetUint8Provided is exactly like MustGetUint8 but also return if the key was changed somewhere in the configuration stack.

func MustGetUint16

func MustGetUint16(cmd *cobra.Command, name string) uint16

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

func MustGetUint16Provided(cmd *cobra.Command, name string) (uint16, bool)

MustGetUint16Provided is exactly like MustGetUint16 but also return if the key was changed somewhere in the configuration stack.

func MustGetUint32

func MustGetUint32(cmd *cobra.Command, name string) uint32

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

func MustGetUint32Provided(cmd *cobra.Command, name string) (uint32, bool)

MustGetUint32Provided is exactly like MustGetUint32 but also return if the key was changed somewhere in the configuration stack.

func MustGetUint64

func MustGetUint64(cmd *cobra.Command, name string) uint64

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

func MustGetUint64Provided(cmd *cobra.Command, name string) (uint64, bool)

MustGetUint64Provided is exactly like MustGetUint64 but also return if the key was changed somewhere in the configuration stack.

func MustGetUintProvided

func MustGetUintProvided(cmd *cobra.Command, name string) (uint, bool)

MustGetUintProvided is exactly like MustGetUint but also return if the key was changed somewhere in the configuration stack.

func MustGetUintSlice

func MustGetUintSlice(cmd *cobra.Command, name string) []uint

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

func MustGetUintSliceProvided(cmd *cobra.Command, name string) ([]uint, bool)

MustGetUintSliceProvided is exactly like MustGetUintSlice but also return if the key was changed somewhere in the configuration stack.

func MustGetViperKey

func MustGetViperKey(cmd *cobra.Command, name string) string

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

func MustGetViperKeyFromFlag(flag *pflag.Flag) string

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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