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

Method BoolVarP

bool.go:54–57  ·  view source on GitHub ↗

BoolVarP is like BoolVar, but accepts a shorthand letter that can be used after a single dash.

(p *bool, name, shorthand string, value bool, usage string)

Source from the content-addressed store, hash-verified

52
53// BoolVarP is like BoolVar, but accepts a shorthand letter that can be used after a single dash.
54func (f *FlagSet) BoolVarP(p *bool, name, shorthand string, value bool, usage string) {
55 flag := f.VarPF(newBoolValue(value, p), name, shorthand, usage)
56 flag.NoOptDefVal = "true"
57}
58
59// BoolVar defines a bool flag with specified name, default value, and usage string.
60// The argument p points to a bool variable in which to store the value of the flag.

Callers 2

BoolVarMethod · 0.95
BoolPMethod · 0.95

Calls 2

VarPFMethod · 0.95
newBoolValueFunction · 0.85

Tested by

no test coverage detected