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

Method DurationP

duration.go:71–75  ·  view source on GitHub ↗

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

(name, shorthand string, value time.Duration, usage string)

Source from the content-addressed store, hash-verified

69
70// DurationP is like Duration, but accepts a shorthand letter that can be used after a single dash.
71func (f *FlagSet) DurationP(name, shorthand string, value time.Duration, usage string) *time.Duration {
72 p := new(time.Duration)
73 f.DurationVarP(p, name, shorthand, value, usage)
74 return p
75}
76
77// Duration defines a time.Duration flag with specified name, default value, and usage string.
78// The return value is the address of a time.Duration variable that stores the value of the flag.

Callers 2

DurationFunction · 0.80
DurationPFunction · 0.80

Calls 1

DurationVarPMethod · 0.95

Tested by

no test coverage detected