MCPcopy
hub / github.com/spf13/viper / BindPFlags

Method BindPFlags

viper.go:1063–1065  ·  view source on GitHub ↗
(flags *pflag.FlagSet)

Source from the content-addressed store, hash-verified

1061func BindPFlags(flags *pflag.FlagSet) error { return v.BindPFlags(flags) }
1062
1063func (v *Viper) BindPFlags(flags *pflag.FlagSet) error {
1064 return v.BindFlagValues(pflagValueSet{flags})
1065}
1066
1067// BindPFlag binds a specific key to a pflag (as used by cobra).
1068// Example (where serverCmd is a Cobra instance):

Callers 11

TestBindPFlagsFunction · 0.80
TestBindPFlagsSlicesFunction · 0.80
TestBindPFlagsIntSliceFunction · 0.80
TestBindPFlagStringToIntFunction · 0.80
TestFlagShadowFunction · 0.80
BindPFlagsFunction · 0.80

Calls 1

BindFlagValuesMethod · 0.95

Tested by 10

TestBindPFlagsFunction · 0.64
TestBindPFlagsSlicesFunction · 0.64
TestBindPFlagsIntSliceFunction · 0.64
TestBindPFlagStringToIntFunction · 0.64
TestFlagShadowFunction · 0.64