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

Method DurationSliceVar

duration_slice.go:122–124  ·  view source on GitHub ↗

DurationSliceVar defines a durationSlice flag with specified name, default value, and usage string. The argument p points to a []time.Duration variable in which to store the value of the flag.

(p *[]time.Duration, name string, value []time.Duration, usage string)

Source from the content-addressed store, hash-verified

120// DurationSliceVar defines a durationSlice flag with specified name, default value, and usage string.
121// The argument p points to a []time.Duration variable in which to store the value of the flag.
122func (f *FlagSet) DurationSliceVar(p *[]time.Duration, name string, value []time.Duration, usage string) {
123 f.VarP(newDurationSliceValue(value, p), name, "", usage)
124}
125
126// DurationSliceVarP is like DurationSliceVar, but accepts a shorthand letter that can be used after a single dash.
127func (f *FlagSet) DurationSliceVarP(p *[]time.Duration, name, shorthand string, value []time.Duration, usage string) {

Callers 2

setUpDSFlagSetFunction · 0.95

Calls 2

VarPMethod · 0.95
newDurationSliceValueFunction · 0.85

Tested by 2

setUpDSFlagSetFunction · 0.76