MCPcopy
hub / github.com/spf13/pflag / VarPF

Method VarPF

flag.go:852–863  ·  view source on GitHub ↗

VarPF is like VarP, but returns the flag created

(value Value, name, shorthand, usage string)

Source from the content-addressed store, hash-verified

850
851// VarPF is like VarP, but returns the flag created
852func (f *FlagSet) VarPF(value Value, name, shorthand, usage string) *Flag {
853 // Remember the default value as a string; it won't change.
854 flag := &Flag{
855 Name: name,
856 Shorthand: shorthand,
857 Usage: usage,
858 Value: value,
859 DefValue: value.String(),
860 }
861 f.AddFlag(flag)
862 return flag
863}
864
865// VarP is like Var, but accepts a shorthand letter that can be used after a single dash.
866func (f *FlagSet) VarP(value Value, name, shorthand, usage string) {

Callers 6

BoolVarPMethod · 0.95
CountVarPMethod · 0.95
BoolFuncPMethod · 0.95
VarPMethod · 0.95
setUpFlagSetFunction · 0.95
BoolVarPFunction · 0.80

Calls 2

AddFlagMethod · 0.95
StringMethod · 0.65

Tested by 1

setUpFlagSetFunction · 0.76