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

Method Count

count.go:73–77  ·  view source on GitHub ↗

Count defines a count flag with specified name, default value, and usage string. The return value is the address of an int variable that stores the value of the flag. A count flag will add 1 to its value every time it is found on the command line

(name string, usage string)

Source from the content-addressed store, hash-verified

71// The return value is the address of an int variable that stores the value of the flag.
72// A count flag will add 1 to its value every time it is found on the command line
73func (f *FlagSet) Count(name string, usage string) *int {
74 p := new(int)
75 f.CountVarP(p, name, "", usage)
76 return p
77}
78
79// CountP is like Count only takes a shorthand for the flag name.
80func (f *FlagSet) CountP(name, shorthand string, usage string) *int {

Callers 1

SetMethod · 0.80

Calls 1

CountVarPMethod · 0.95

Tested by

no test coverage detected