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

Method StringP

string.go:65–69  ·  string.go::FlagSet.StringP

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

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

Source from the content-addressed store, hash-verified

63
64// StringP is like String, but accepts a shorthand letter that can be used after a single dash.
65func (f *FlagSet) StringP(name, shorthand string, value string, usage string) *string {
66 p := new(string)
67 f.StringVarP(p, name, shorthand, value, usage)
68 return p
69}
70
71// String defines a string flag with specified name, default value, and usage string.
72// The return value is the address of a string variable that stores the value of the flag.

Callers 7

setUpPFlagSet2Function · 0.95
TestAnnotationFunction · 0.95
TestShorthandFunction · 0.95
StringFunction · 0.80
StringPFunction · 0.80
testParseAllFunction · 0.80

Calls 1

StringVarPMethod · 0.95

Tested by 5

setUpPFlagSet2Function · 0.76
TestAnnotationFunction · 0.76
TestShorthandFunction · 0.76
testParseAllFunction · 0.64