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

Method StringArray

string_array.go:102–106  ·  view source on GitHub ↗

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.

(name string, value []string, usage string)

Source from the content-addressed store, hash-verified

100// The return value is the address of a []string variable that stores the value of the flag.
101// The value of each argument will not try to be separated by comma. Use a StringSlice for that.
102func (f *FlagSet) StringArray(name string, value []string, usage string) *[]string {
103 p := []string{}
104 f.StringArrayVarP(&p, name, "", value, usage)
105 return &p
106}
107
108// StringArrayP is like StringArray, but accepts a shorthand letter that can be used after a single dash.
109func (f *FlagSet) StringArrayP(name, shorthand string, value []string, usage string) *[]string {

Callers 1

TestPrintDefaultsFunction · 0.95

Calls 1

StringArrayVarPMethod · 0.95

Tested by 1

TestPrintDefaultsFunction · 0.76