code
stringlengths
12
335k
docstring
stringlengths
20
20.8k
func_name
stringlengths
1
105
language
stringclasses
1 value
repo
stringclasses
498 values
path
stringlengths
5
172
url
stringlengths
43
235
license
stringclasses
4 values
func BoolSliceVar(p *[]bool, name string, value []bool, usage string) { CommandLine.VarP(newBoolSliceValue(value, p), name, "", usage) }
BoolSliceVar defines a []bool flag with specified name, default value, and usage string. The argument p points to a []bool variable in which to store the value of the flag.
BoolSliceVar
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/bool_slice.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/bool_slice.go
Apache-2.0
func BoolSliceVarP(p *[]bool, name, shorthand string, value []bool, usage string) { CommandLine.VarP(newBoolSliceValue(value, p), name, shorthand, usage) }
BoolSliceVarP is like BoolSliceVar, but accepts a shorthand letter that can be used after a single dash.
BoolSliceVarP
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/bool_slice.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/bool_slice.go
Apache-2.0
func (f *FlagSet) BoolSlice(name string, value []bool, usage string) *[]bool { p := []bool{} f.BoolSliceVarP(&p, name, "", value, usage) return &p }
BoolSlice defines a []bool flag with specified name, default value, and usage string. The return value is the address of a []bool variable that stores the value of the flag.
BoolSlice
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/bool_slice.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/bool_slice.go
Apache-2.0
func (f *FlagSet) BoolSliceP(name, shorthand string, value []bool, usage string) *[]bool { p := []bool{} f.BoolSliceVarP(&p, name, shorthand, value, usage) return &p }
BoolSliceP is like BoolSlice, but accepts a shorthand letter that can be used after a single dash.
BoolSliceP
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/bool_slice.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/bool_slice.go
Apache-2.0
func BoolSlice(name string, value []bool, usage string) *[]bool { return CommandLine.BoolSliceP(name, "", value, usage) }
BoolSlice defines a []bool flag with specified name, default value, and usage string. The return value is the address of a []bool variable that stores the value of the flag.
BoolSlice
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/bool_slice.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/bool_slice.go
Apache-2.0
func BoolSliceP(name, shorthand string, value []bool, usage string) *[]bool { return CommandLine.BoolSliceP(name, shorthand, value, usage) }
BoolSliceP is like BoolSlice, but accepts a shorthand letter that can be used after a single dash.
BoolSliceP
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/bool_slice.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/bool_slice.go
Apache-2.0
func (f *FlagSet) GetUintSlice(name string) ([]uint, error) { val, err := f.getFlagType(name, "uintSlice", uintSliceConv) if err != nil { return []uint{}, err } return val.([]uint), nil }
GetUintSlice returns the []uint value of a flag with the given name.
GetUintSlice
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint_slice.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint_slice.go
Apache-2.0
func (f *FlagSet) UintSliceVar(p *[]uint, name string, value []uint, usage string) { f.VarP(newUintSliceValue(value, p), name, "", usage) }
UintSliceVar defines a uintSlice flag with specified name, default value, and usage string. The argument p points to a []uint variable in which to store the value of the flag.
UintSliceVar
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint_slice.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint_slice.go
Apache-2.0
func (f *FlagSet) UintSliceVarP(p *[]uint, name, shorthand string, value []uint, usage string) { f.VarP(newUintSliceValue(value, p), name, shorthand, usage) }
UintSliceVarP is like UintSliceVar, but accepts a shorthand letter that can be used after a single dash.
UintSliceVarP
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint_slice.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint_slice.go
Apache-2.0
func UintSliceVar(p *[]uint, name string, value []uint, usage string) { CommandLine.VarP(newUintSliceValue(value, p), name, "", usage) }
UintSliceVar defines a uint[] flag with specified name, default value, and usage string. The argument p points to a uint[] variable in which to store the value of the flag.
UintSliceVar
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint_slice.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint_slice.go
Apache-2.0
func UintSliceVarP(p *[]uint, name, shorthand string, value []uint, usage string) { CommandLine.VarP(newUintSliceValue(value, p), name, shorthand, usage) }
UintSliceVarP is like the UintSliceVar, but accepts a shorthand letter that can be used after a single dash.
UintSliceVarP
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint_slice.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint_slice.go
Apache-2.0
func (f *FlagSet) UintSlice(name string, value []uint, usage string) *[]uint { p := []uint{} f.UintSliceVarP(&p, name, "", value, usage) return &p }
UintSlice defines a []uint flag with specified name, default value, and usage string. The return value is the address of a []uint variable that stores the value of the flag.
UintSlice
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint_slice.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint_slice.go
Apache-2.0
func (f *FlagSet) UintSliceP(name, shorthand string, value []uint, usage string) *[]uint { p := []uint{} f.UintSliceVarP(&p, name, shorthand, value, usage) return &p }
UintSliceP is like UintSlice, but accepts a shorthand letter that can be used after a single dash.
UintSliceP
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint_slice.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint_slice.go
Apache-2.0
func UintSlice(name string, value []uint, usage string) *[]uint { return CommandLine.UintSliceP(name, "", value, usage) }
UintSlice defines a []uint flag with specified name, default value, and usage string. The return value is the address of a []uint variable that stores the value of the flag.
UintSlice
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint_slice.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint_slice.go
Apache-2.0
func UintSliceP(name, shorthand string, value []uint, usage string) *[]uint { return CommandLine.UintSliceP(name, shorthand, value, usage) }
UintSliceP is like UintSlice, but accepts a shorthand letter that can be used after a single dash.
UintSliceP
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint_slice.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint_slice.go
Apache-2.0
func (f *FlagSet) GetCount(name string) (int, error) { val, err := f.getFlagType(name, "count", countConv) if err != nil { return 0, err } return val.(int), nil }
GetCount return the int value of a flag with the given name
GetCount
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/count.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/count.go
Apache-2.0
func (f *FlagSet) CountVar(p *int, name string, usage string) { f.CountVarP(p, name, "", usage) }
CountVar defines a count flag with specified name, default value, and usage string. The argument p points to an int variable in which to store the value of the flag. A count flag will add 1 to its value every time it is found on the command line
CountVar
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/count.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/count.go
Apache-2.0
func (f *FlagSet) CountVarP(p *int, name, shorthand string, usage string) { flag := f.VarPF(newCountValue(0, p), name, shorthand, usage) flag.NoOptDefVal = "+1" }
CountVarP is like CountVar only take a shorthand for the flag name.
CountVarP
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/count.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/count.go
Apache-2.0
func CountVar(p *int, name string, usage string) { CommandLine.CountVar(p, name, usage) }
CountVar like CountVar only the flag is placed on the CommandLine instead of a given flag set
CountVar
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/count.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/count.go
Apache-2.0
func CountVarP(p *int, name, shorthand string, usage string) { CommandLine.CountVarP(p, name, shorthand, usage) }
CountVarP is like CountVar only take a shorthand for the flag name.
CountVarP
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/count.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/count.go
Apache-2.0
func (f *FlagSet) Count(name string, usage string) *int { p := new(int) f.CountVarP(p, name, "", usage) return p }
Count defines a count flag with specified name, default value, and usage string. The return value is the address of an int variable that stores the value of the flag. A count flag will add 1 to its value every time it is found on the command line
Count
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/count.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/count.go
Apache-2.0
func (f *FlagSet) CountP(name, shorthand string, usage string) *int { p := new(int) f.CountVarP(p, name, shorthand, usage) return p }
CountP is like Count only takes a shorthand for the flag name.
CountP
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/count.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/count.go
Apache-2.0
func Count(name string, usage string) *int { return CommandLine.CountP(name, "", usage) }
Count defines a count flag with specified name, default value, and usage string. The return value is the address of an int variable that stores the value of the flag. A count flag will add 1 to its value evey time it is found on the command line
Count
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/count.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/count.go
Apache-2.0
func CountP(name, shorthand string, usage string) *int { return CommandLine.CountP(name, shorthand, usage) }
CountP is like Count only takes a shorthand for the flag name.
CountP
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/count.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/count.go
Apache-2.0
func sortFlags(flags map[NormalizedName]*Flag) []*Flag { list := make(sort.StringSlice, len(flags)) i := 0 for k := range flags { list[i] = string(k) i++ } list.Sort() result := make([]*Flag, len(list)) for i, name := range list { result[i] = flags[NormalizedName(name)] } return result }
sortFlags returns the flags as a slice in lexicographical sorted order.
sortFlags
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func (f *FlagSet) SetNormalizeFunc(n func(f *FlagSet, name string) NormalizedName) { f.normalizeNameFunc = n f.sortedFormal = f.sortedFormal[:0] for fname, flag := range f.formal { nname := f.normalizeFlagName(flag.Name) if fname == nname { continue } flag.Name = string(nname) delete(f.formal, fname) f.formal[nname] = flag if _, set := f.actual[fname]; set { delete(f.actual, fname) f.actual[nname] = flag } } }
SetNormalizeFunc allows you to add a function which can translate flag names. Flags added to the FlagSet will be translated and then when anything tries to look up the flag that will also be translated. So it would be possible to create a flag named "getURL" and have it translated to "geturl". A user could then pass "--getUrl" which may also be translated to "geturl" and everything will work.
SetNormalizeFunc
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func (f *FlagSet) GetNormalizeFunc() func(f *FlagSet, name string) NormalizedName { if f.normalizeNameFunc != nil { return f.normalizeNameFunc } return func(f *FlagSet, name string) NormalizedName { return NormalizedName(name) } }
GetNormalizeFunc returns the previously set NormalizeFunc of a function which does no translation, if not set previously.
GetNormalizeFunc
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func (f *FlagSet) SetOutput(output io.Writer) { f.output = output }
SetOutput sets the destination for usage and error messages. If output is nil, os.Stderr is used.
SetOutput
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func (f *FlagSet) VisitAll(fn func(*Flag)) { if len(f.formal) == 0 { return } var flags []*Flag if f.SortFlags { if len(f.formal) != len(f.sortedFormal) { f.sortedFormal = sortFlags(f.formal) } flags = f.sortedFormal } else { flags = f.orderedFormal } for _, flag := range flags { fn(flag) } }
VisitAll visits the flags in lexicographical order or in primordial order if f.SortFlags is false, calling fn for each. It visits all flags, even those not set.
VisitAll
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func (f *FlagSet) HasFlags() bool { return len(f.formal) > 0 }
HasFlags returns a bool to indicate if the FlagSet has any flags defined.
HasFlags
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func (f *FlagSet) HasAvailableFlags() bool { for _, flag := range f.formal { if !flag.Hidden { return true } } return false }
HasAvailableFlags returns a bool to indicate if the FlagSet has any flags that are not hidden.
HasAvailableFlags
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func VisitAll(fn func(*Flag)) { CommandLine.VisitAll(fn) }
VisitAll visits the command-line flags in lexicographical order or in primordial order if f.SortFlags is false, calling fn for each. It visits all flags, even those not set.
VisitAll
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func (f *FlagSet) Visit(fn func(*Flag)) { if len(f.actual) == 0 { return } var flags []*Flag if f.SortFlags { if len(f.actual) != len(f.sortedActual) { f.sortedActual = sortFlags(f.actual) } flags = f.sortedActual } else { flags = f.orderedActual } for _, flag := range flags { fn(flag) } }
Visit visits the flags in lexicographical order or in primordial order if f.SortFlags is false, calling fn for each. It visits only those flags that have been set.
Visit
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func Visit(fn func(*Flag)) { CommandLine.Visit(fn) }
Visit visits the command-line flags in lexicographical order or in primordial order if f.SortFlags is false, calling fn for each. It visits only those flags that have been set.
Visit
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func (f *FlagSet) Lookup(name string) *Flag { return f.lookup(f.normalizeFlagName(name)) }
Lookup returns the Flag structure of the named flag, returning nil if none exists.
Lookup
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func (f *FlagSet) ShorthandLookup(name string) *Flag { if name == "" { return nil } if len(name) > 1 { msg := fmt.Sprintf("can not look up shorthand which is more than one ASCII character: %q", name) fmt.Fprintf(f.out(), msg) panic(msg) } c := name[0] return f.shorthands[c] }
ShorthandLookup returns the Flag structure of the short handed flag, returning nil if none exists. It panics, if len(name) > 1.
ShorthandLookup
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func (f *FlagSet) lookup(name NormalizedName) *Flag { return f.formal[name] }
lookup returns the Flag structure of the named flag, returning nil if none exists.
lookup
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func (f *FlagSet) getFlagType(name string, ftype string, convFunc func(sval string) (interface{}, error)) (interface{}, error) { flag := f.Lookup(name) if flag == nil { err := fmt.Errorf("flag accessed but not defined: %s", name) return nil, err } if flag.Value.Type() != ftype { err := fmt.Errorf("trying to get %s value of flag of type %s", ftype, flag.Value.Type()) return nil, err } sval := flag.Value.String() result, err := convFunc(sval) if err != nil { return nil, err } return result, nil }
func to return a given type for a given flag name
getFlagType
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func (f *FlagSet) ArgsLenAtDash() int { return f.argsLenAtDash }
ArgsLenAtDash will return the length of f.Args at the moment when a -- was found during arg parsing. This allows your program to know which args were before the -- and which came after.
ArgsLenAtDash
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func (f *FlagSet) MarkDeprecated(name string, usageMessage string) error { flag := f.Lookup(name) if flag == nil { return fmt.Errorf("flag %q does not exist", name) } if usageMessage == "" { return fmt.Errorf("deprecated message for flag %q must be set", name) } flag.Deprecated = usageMessage flag.Hidden = true return nil }
MarkDeprecated indicated that a flag is deprecated in your program. It will continue to function but will not show up in help or usage messages. Using this flag will also print the given usageMessage.
MarkDeprecated
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func (f *FlagSet) MarkShorthandDeprecated(name string, usageMessage string) error { flag := f.Lookup(name) if flag == nil { return fmt.Errorf("flag %q does not exist", name) } if usageMessage == "" { return fmt.Errorf("deprecated message for flag %q must be set", name) } flag.ShorthandDeprecated = usageMessage return nil }
MarkShorthandDeprecated will mark the shorthand of a flag deprecated in your program. It will continue to function but will not show up in help or usage messages. Using this flag will also print the given usageMessage.
MarkShorthandDeprecated
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func (f *FlagSet) MarkHidden(name string) error { flag := f.Lookup(name) if flag == nil { return fmt.Errorf("flag %q does not exist", name) } flag.Hidden = true return nil }
MarkHidden sets a flag to 'hidden' in your program. It will continue to function but will not show up in help or usage messages.
MarkHidden
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func Lookup(name string) *Flag { return CommandLine.Lookup(name) }
Lookup returns the Flag structure of the named command-line flag, returning nil if none exists.
Lookup
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func ShorthandLookup(name string) *Flag { return CommandLine.ShorthandLookup(name) }
ShorthandLookup returns the Flag structure of the short handed flag, returning nil if none exists.
ShorthandLookup
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func (f *FlagSet) Set(name, value string) error { normalName := f.normalizeFlagName(name) flag, ok := f.formal[normalName] if !ok { return fmt.Errorf("no such flag -%v", name) } err := flag.Value.Set(value) if err != nil { var flagName string if flag.Shorthand != "" && flag.ShorthandDeprecated == "" { flagName = fmt.Sprintf("-%s, --%s", flag.Shorthand, flag.Name) } else { flagName = fmt.Sprintf("--%s", flag.Name) } return fmt.Errorf("invalid argument %q for %q flag: %v", value, flagName, err) } if !flag.Changed { if f.actual == nil { f.actual = make(map[NormalizedName]*Flag) } f.actual[normalName] = flag f.orderedActual = append(f.orderedActual, flag) flag.Changed = true } if flag.Deprecated != "" { fmt.Fprintf(f.out(), "Flag --%s has been deprecated, %s\n", flag.Name, flag.Deprecated) } return nil }
Set sets the value of the named flag.
Set
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func (f *FlagSet) SetAnnotation(name, key string, values []string) error { normalName := f.normalizeFlagName(name) flag, ok := f.formal[normalName] if !ok { return fmt.Errorf("no such flag -%v", name) } if flag.Annotations == nil { flag.Annotations = map[string][]string{} } flag.Annotations[key] = values return nil }
SetAnnotation allows one to set arbitrary annotations on a flag in the FlagSet. This is sometimes used by spf13/cobra programs which want to generate additional bash completion information.
SetAnnotation
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func (f *FlagSet) Changed(name string) bool { flag := f.Lookup(name) // If a flag doesn't exist, it wasn't changed.... if flag == nil { return false } return flag.Changed }
Changed returns true if the flag was explicitly set during Parse() and false otherwise
Changed
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func Set(name, value string) error { return CommandLine.Set(name, value) }
Set sets the value of the named command-line flag.
Set
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func (f *FlagSet) PrintDefaults() { usages := f.FlagUsages() fmt.Fprint(f.out(), usages) }
PrintDefaults prints, to standard error unless configured otherwise, the default values of all defined flags in the set.
PrintDefaults
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func (f *Flag) defaultIsZeroValue() bool { switch f.Value.(type) { case boolFlag: return f.DefValue == "false" case *durationValue: // Beginning in Go 1.7, duration zero values are "0s" return f.DefValue == "0" || f.DefValue == "0s" case *intValue, *int8Value, *int32Value, *int64Value, *uintValue, *uint8Value, *uint16Value, *uint32Value, *uint64Value, *countValue, *float32Value, *float64Value: return f.DefValue == "0" case *stringValue: return f.DefValue == "" case *ipValue, *ipMaskValue, *ipNetValue: return f.DefValue == "<nil>" case *intSliceValue, *stringSliceValue, *stringArrayValue: return f.DefValue == "[]" default: switch f.Value.String() { case "false": return true case "<nil>": return true case "": return true case "0": return true } return false }
defaultIsZeroValue returns true if the default value for this flag represents a zero value.
defaultIsZeroValue
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func UnquoteUsage(flag *Flag) (name string, usage string) { // Look for a back-quoted name, but avoid the strings package. usage = flag.Usage for i := 0; i < len(usage); i++ { if usage[i] == '`' { for j := i + 1; j < len(usage); j++ { if usage[j] == '`' { name = usage[i+1 : j] usage = usage[:i] + name + usage[j+1:] return name, usage } } break // Only one back quote; use type name. } } name = flag.Value.Type() switch name { case "bool": name = "" case "float64": name = "float" case "int64": name = "int" case "uint64": name = "uint" case "stringSlice": name = "strings" case "intSlice": name = "ints" case "uintSlice": name = "uints" case "boolSlice": name = "bools" } return }
UnquoteUsage extracts a back-quoted name from the usage string for a flag and returns it and the un-quoted usage. Given "a `name` to show" it returns ("name", "a name to show"). If there are no back quotes, the name is an educated guess of the type of the flag's value, or the empty string if the flag is boolean.
UnquoteUsage
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func wrapN(i, slop int, s string) (string, string) { if i+slop > len(s) { return s, "" } w := strings.LastIndexAny(s[:i], " \t\n") if w <= 0 { return s, "" } nlPos := strings.LastIndex(s[:i], "\n") if nlPos > 0 && nlPos < w { return s[:nlPos], s[nlPos+1:] } return s[:w], s[w+1:] }
Splits the string `s` on whitespace into an initial substring up to `i` runes in length and the remainder. Will go `slop` over `i` if that encompasses the entire string (which allows the caller to avoid short orphan words on the final line).
wrapN
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func wrap(i, w int, s string) string { if w == 0 { return strings.Replace(s, "\n", "\n"+strings.Repeat(" ", i), -1) } // space between indent i and end of line width w into which // we should wrap the text. wrap := w - i var r, l string // Not enough space for sensible wrapping. Wrap as a block on // the next line instead. if wrap < 24 { i = 16 wrap = w - i r += "\n" + strings.Repeat(" ", i) } // If still not enough space then don't even try to wrap. if wrap < 24 { return strings.Replace(s, "\n", r, -1) } // Try to avoid short orphan words on the final line, by // allowing wrapN to go a bit over if that would fit in the // remainder of the line. slop := 5 wrap = wrap - slop // Handle first line, which is indented by the caller (or the // special case above) l, s = wrapN(wrap, slop, s) r = r + strings.Replace(l, "\n", "\n"+strings.Repeat(" ", i), -1) // Now wrap the rest for s != "" { var t string t, s = wrapN(wrap, slop, s) r = r + "\n" + strings.Repeat(" ", i) + strings.Replace(t, "\n", "\n"+strings.Repeat(" ", i), -1) } return r }
Wraps the string `s` to a maximum width `w` with leading indent `i`. The first line is not indented (this is assumed to be done by caller). Pass `w` == 0 to do no wrapping
wrap
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func PrintDefaults() { CommandLine.PrintDefaults() }
PrintDefaults prints to standard error the default values of all defined command-line flags.
PrintDefaults
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func defaultUsage(f *FlagSet) { fmt.Fprintf(f.out(), "Usage of %s:\n", f.name) f.PrintDefaults() }
defaultUsage is the default function to print a usage message.
defaultUsage
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func NFlag() int { return len(CommandLine.actual) }
NFlag returns the number of command-line flags that have been set.
NFlag
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func Arg(i int) string { return CommandLine.Arg(i) }
Arg returns the i'th command-line argument. Arg(0) is the first remaining argument after flags have been processed.
Arg
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func NArg() int { return len(CommandLine.args) }
NArg is the number of arguments remaining after flags have been processed.
NArg
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func Args() []string { return CommandLine.args }
Args returns the non-flag command-line arguments.
Args
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func Var(value Value, name string, usage string) { CommandLine.VarP(value, name, "", usage) }
Var defines a flag with the specified name and usage string. The type and value of the flag are represented by the first argument, of type Value, which typically holds a user-defined implementation of Value. For instance, the caller could create a flag that turns a comma-separated string into a slice of strings by giving the slice the methods of Value; in particular, Set would decompose the comma-separated string into the slice.
Var
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func VarP(value Value, name, shorthand, usage string) { CommandLine.VarP(value, name, shorthand, usage) }
VarP is like Var, but accepts a shorthand letter that can be used after a single dash.
VarP
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func stripUnknownFlagValue(args []string) []string { if len(args) == 0 { //--unknown return args } first := args[0] if len(first) > 0 && first[0] == '-' { //--unknown --next-flag ... return args } //--unknown arg ... (args will be arg ...) if len(args) > 1 { return args[1:] } return nil }
--unknown (args will be empty) --unknown --next-flag ... (args will be --next-flag ...) --unknown arg ... (args will be arg ...)
stripUnknownFlagValue
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func Parse() { // Ignore errors; CommandLine is set for ExitOnError. CommandLine.Parse(os.Args[1:]) }
Parse parses the command-line flags from os.Args[1:]. Must be called after all flags are defined and before flags are accessed by the program.
Parse
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func ParseAll(fn func(flag *Flag, value string) error) { // Ignore errors; CommandLine is set for ExitOnError. CommandLine.ParseAll(os.Args[1:], fn) }
ParseAll parses the command-line flags from os.Args[1:] and called fn for each. The arguments for fn are flag and value. Must be called after all flags are defined and before flags are accessed by the program.
ParseAll
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func SetInterspersed(interspersed bool) { CommandLine.SetInterspersed(interspersed) }
SetInterspersed sets whether to support interspersed option/non-option arguments.
SetInterspersed
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func Parsed() bool { return CommandLine.Parsed() }
Parsed returns true if the command-line flags have been parsed.
Parsed
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func NewFlagSet(name string, errorHandling ErrorHandling) *FlagSet { f := &FlagSet{ name: name, errorHandling: errorHandling, argsLenAtDash: -1, interspersed: true, SortFlags: true, } return f }
NewFlagSet returns a new, empty flag set with the specified name, error handling property and SortFlags set to true.
NewFlagSet
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/flag.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/flag.go
Apache-2.0
func (f *FlagSet) GetUint16(name string) (uint16, error) { val, err := f.getFlagType(name, "uint16", uint16Conv) if err != nil { return 0, err } return val.(uint16), nil }
GetUint16 return the uint16 value of a flag with the given name
GetUint16
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint16.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint16.go
Apache-2.0
func (f *FlagSet) Uint16Var(p *uint16, name string, value uint16, usage string) { f.VarP(newUint16Value(value, p), name, "", usage) }
Uint16Var defines a uint flag with specified name, default value, and usage string. The argument p points to a uint variable in which to store the value of the flag.
Uint16Var
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint16.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint16.go
Apache-2.0
func (f *FlagSet) Uint16VarP(p *uint16, name, shorthand string, value uint16, usage string) { f.VarP(newUint16Value(value, p), name, shorthand, usage) }
Uint16VarP is like Uint16Var, but accepts a shorthand letter that can be used after a single dash.
Uint16VarP
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint16.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint16.go
Apache-2.0
func Uint16Var(p *uint16, name string, value uint16, usage string) { CommandLine.VarP(newUint16Value(value, p), name, "", usage) }
Uint16Var defines a uint flag with specified name, default value, and usage string. The argument p points to a uint variable in which to store the value of the flag.
Uint16Var
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint16.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint16.go
Apache-2.0
func Uint16VarP(p *uint16, name, shorthand string, value uint16, usage string) { CommandLine.VarP(newUint16Value(value, p), name, shorthand, usage) }
Uint16VarP is like Uint16Var, but accepts a shorthand letter that can be used after a single dash.
Uint16VarP
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint16.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint16.go
Apache-2.0
func (f *FlagSet) Uint16(name string, value uint16, usage string) *uint16 { p := new(uint16) f.Uint16VarP(p, name, "", value, usage) return p }
Uint16 defines a uint flag with specified name, default value, and usage string. The return value is the address of a uint variable that stores the value of the flag.
Uint16
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint16.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint16.go
Apache-2.0
func (f *FlagSet) Uint16P(name, shorthand string, value uint16, usage string) *uint16 { p := new(uint16) f.Uint16VarP(p, name, shorthand, value, usage) return p }
Uint16P is like Uint16, but accepts a shorthand letter that can be used after a single dash.
Uint16P
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint16.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint16.go
Apache-2.0
func Uint16(name string, value uint16, usage string) *uint16 { return CommandLine.Uint16P(name, "", value, usage) }
Uint16 defines a uint flag with specified name, default value, and usage string. The return value is the address of a uint variable that stores the value of the flag.
Uint16
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint16.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint16.go
Apache-2.0
func Uint16P(name, shorthand string, value uint16, usage string) *uint16 { return CommandLine.Uint16P(name, shorthand, value, usage) }
Uint16P is like Uint16, but accepts a shorthand letter that can be used after a single dash.
Uint16P
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint16.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint16.go
Apache-2.0
func (f *FlagSet) GetStringArray(name string) ([]string, error) { val, err := f.getFlagType(name, "stringArray", stringArrayConv) if err != nil { return []string{}, err } return val.([]string), nil }
GetStringArray return the []string value of a flag with the given name
GetStringArray
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/string_array.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/string_array.go
Apache-2.0
func (f *FlagSet) StringArrayVar(p *[]string, name string, value []string, usage string) { f.VarP(newStringArrayValue(value, p), name, "", usage) }
StringArrayVar defines a string flag with specified name, default value, and usage string. The argument p points to a []string variable in which to store the values of the multiple flags. The value of each argument will not try to be separated by comma. Use a StringSlice for that.
StringArrayVar
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/string_array.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/string_array.go
Apache-2.0
func (f *FlagSet) StringArrayVarP(p *[]string, name, shorthand string, value []string, usage string) { f.VarP(newStringArrayValue(value, p), name, shorthand, usage) }
StringArrayVarP is like StringArrayVar, but accepts a shorthand letter that can be used after a single dash.
StringArrayVarP
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/string_array.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/string_array.go
Apache-2.0
func StringArrayVar(p *[]string, name string, value []string, usage string) { CommandLine.VarP(newStringArrayValue(value, p), name, "", usage) }
StringArrayVar defines a string flag with specified name, default value, and usage string. The argument p points to a []string variable in which to store the value of the flag. The value of each argument will not try to be separated by comma. Use a StringSlice for that.
StringArrayVar
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/string_array.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/string_array.go
Apache-2.0
func StringArrayVarP(p *[]string, name, shorthand string, value []string, usage string) { CommandLine.VarP(newStringArrayValue(value, p), name, shorthand, usage) }
StringArrayVarP is like StringArrayVar, but accepts a shorthand letter that can be used after a single dash.
StringArrayVarP
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/string_array.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/string_array.go
Apache-2.0
func (f *FlagSet) StringArray(name string, value []string, usage string) *[]string { p := []string{} f.StringArrayVarP(&p, name, "", value, usage) return &p }
StringArray defines a string flag with specified name, default value, and usage string. The return value is the address of a []string variable that stores the value of the flag. The value of each argument will not try to be separated by comma. Use a StringSlice for that.
StringArray
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/string_array.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/string_array.go
Apache-2.0
func (f *FlagSet) StringArrayP(name, shorthand string, value []string, usage string) *[]string { p := []string{} f.StringArrayVarP(&p, name, shorthand, value, usage) return &p }
StringArrayP is like StringArray, but accepts a shorthand letter that can be used after a single dash.
StringArrayP
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/string_array.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/string_array.go
Apache-2.0
func StringArray(name string, value []string, usage string) *[]string { return CommandLine.StringArrayP(name, "", value, usage) }
StringArray defines a string flag with specified name, default value, and usage string. The return value is the address of a []string variable that stores the value of the flag. The value of each argument will not try to be separated by comma. Use a StringSlice for that.
StringArray
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/string_array.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/string_array.go
Apache-2.0
func StringArrayP(name, shorthand string, value []string, usage string) *[]string { return CommandLine.StringArrayP(name, shorthand, value, usage) }
StringArrayP is like StringArray, but accepts a shorthand letter that can be used after a single dash.
StringArrayP
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/string_array.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/string_array.go
Apache-2.0
func (f *FlagSet) GetUint8(name string) (uint8, error) { val, err := f.getFlagType(name, "uint8", uint8Conv) if err != nil { return 0, err } return val.(uint8), nil }
GetUint8 return the uint8 value of a flag with the given name
GetUint8
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint8.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint8.go
Apache-2.0
func (f *FlagSet) Uint8Var(p *uint8, name string, value uint8, usage string) { f.VarP(newUint8Value(value, p), name, "", usage) }
Uint8Var defines a uint8 flag with specified name, default value, and usage string. The argument p points to a uint8 variable in which to store the value of the flag.
Uint8Var
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint8.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint8.go
Apache-2.0
func (f *FlagSet) Uint8VarP(p *uint8, name, shorthand string, value uint8, usage string) { f.VarP(newUint8Value(value, p), name, shorthand, usage) }
Uint8VarP is like Uint8Var, but accepts a shorthand letter that can be used after a single dash.
Uint8VarP
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint8.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint8.go
Apache-2.0
func Uint8Var(p *uint8, name string, value uint8, usage string) { CommandLine.VarP(newUint8Value(value, p), name, "", usage) }
Uint8Var defines a uint8 flag with specified name, default value, and usage string. The argument p points to a uint8 variable in which to store the value of the flag.
Uint8Var
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint8.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint8.go
Apache-2.0
func Uint8VarP(p *uint8, name, shorthand string, value uint8, usage string) { CommandLine.VarP(newUint8Value(value, p), name, shorthand, usage) }
Uint8VarP is like Uint8Var, but accepts a shorthand letter that can be used after a single dash.
Uint8VarP
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint8.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint8.go
Apache-2.0
func (f *FlagSet) Uint8(name string, value uint8, usage string) *uint8 { p := new(uint8) f.Uint8VarP(p, name, "", value, usage) return p }
Uint8 defines a uint8 flag with specified name, default value, and usage string. The return value is the address of a uint8 variable that stores the value of the flag.
Uint8
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint8.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint8.go
Apache-2.0
func (f *FlagSet) Uint8P(name, shorthand string, value uint8, usage string) *uint8 { p := new(uint8) f.Uint8VarP(p, name, shorthand, value, usage) return p }
Uint8P is like Uint8, but accepts a shorthand letter that can be used after a single dash.
Uint8P
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint8.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint8.go
Apache-2.0
func Uint8(name string, value uint8, usage string) *uint8 { return CommandLine.Uint8P(name, "", value, usage) }
Uint8 defines a uint8 flag with specified name, default value, and usage string. The return value is the address of a uint8 variable that stores the value of the flag.
Uint8
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint8.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint8.go
Apache-2.0
func Uint8P(name, shorthand string, value uint8, usage string) *uint8 { return CommandLine.Uint8P(name, shorthand, value, usage) }
Uint8P is like Uint8, but accepts a shorthand letter that can be used after a single dash.
Uint8P
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/uint8.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint8.go
Apache-2.0
func (f *FlagSet) GetInt(name string) (int, error) { val, err := f.getFlagType(name, "int", intConv) if err != nil { return 0, err } return val.(int), nil }
GetInt return the int value of a flag with the given name
GetInt
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/int.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/int.go
Apache-2.0
func (f *FlagSet) IntVar(p *int, name string, value int, usage string) { f.VarP(newIntValue(value, p), name, "", usage) }
IntVar defines an int flag with specified name, default value, and usage string. The argument p points to an int variable in which to store the value of the flag.
IntVar
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/int.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/int.go
Apache-2.0
func (f *FlagSet) IntVarP(p *int, name, shorthand string, value int, usage string) { f.VarP(newIntValue(value, p), name, shorthand, usage) }
IntVarP is like IntVar, but accepts a shorthand letter that can be used after a single dash.
IntVarP
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/int.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/int.go
Apache-2.0
func IntVar(p *int, name string, value int, usage string) { CommandLine.VarP(newIntValue(value, p), name, "", usage) }
IntVar defines an int flag with specified name, default value, and usage string. The argument p points to an int variable in which to store the value of the flag.
IntVar
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/int.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/int.go
Apache-2.0
func IntVarP(p *int, name, shorthand string, value int, usage string) { CommandLine.VarP(newIntValue(value, p), name, shorthand, usage) }
IntVarP is like IntVar, but accepts a shorthand letter that can be used after a single dash.
IntVarP
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/int.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/int.go
Apache-2.0
func (f *FlagSet) Int(name string, value int, usage string) *int { p := new(int) f.IntVarP(p, name, "", value, usage) return p }
Int defines an int flag with specified name, default value, and usage string. The return value is the address of an int variable that stores the value of the flag.
Int
go
k8snetworkplumbingwg/multus-cni
vendor/github.com/spf13/pflag/int.go
https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/int.go
Apache-2.0