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

Method BoolP

bool.go:78–82  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

76
77// BoolP is like Bool, but accepts a shorthand letter that can be used after a single dash.
78func (f *FlagSet) BoolP(name, shorthand string, value bool, usage string) *bool {
79 p := new(bool)
80 f.BoolVarP(p, name, shorthand, value, usage)
81 return p
82}
83
84// Bool defines a bool flag with specified name, default value, and usage string.
85// The return value is the address of a bool variable that stores the value of the flag.

Callers 13

BoolMethod · 0.95
setUpPFlagSetFunction · 0.95
setUpPFlagSet2Function · 0.95
TestShorthandFunction · 0.95
TestShorthandLookupFunction · 0.95
TestTerminationFunction · 0.95
TestPrintDefaultsFunction · 0.95
BoolPFunction · 0.80
testParseAllFunction · 0.80

Calls 1

BoolVarPMethod · 0.95

Tested by 11

setUpPFlagSetFunction · 0.76
setUpPFlagSet2Function · 0.76
TestShorthandFunction · 0.76
TestShorthandLookupFunction · 0.76
TestTerminationFunction · 0.76
TestPrintDefaultsFunction · 0.76
testParseAllFunction · 0.64