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

Method StringSliceVar

string_slice.go:104–106  ·  view source on GitHub ↗

StringSliceVar defines a string flag with specified name, default value, and usage string. The argument p points to a []string variable in which to store the value of the flag. Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. For ex

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

Source from the content-addressed store, hash-verified

102// will result in
103// []string{"v1", "v2", "v3"}
104func (f *FlagSet) StringSliceVar(p *[]string, name string, value []string, usage string) {
105 f.VarP(newStringSliceValue(value, p), name, "", usage)
106}
107
108// StringSliceVarP is like StringSliceVar, but accepts a shorthand letter that can be used after a single dash.
109func (f *FlagSet) StringSliceVarP(p *[]string, name, shorthand string, value []string, usage string) {

Callers 2

setUpSSFlagSetFunction · 0.95

Calls 2

VarPMethod · 0.95
newStringSliceValueFunction · 0.85

Tested by 2

setUpSSFlagSetFunction · 0.76