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

Function BoolFunc

bool_func.go:33–35  ·  view source on GitHub ↗

BoolFunc defines a func flag with specified name, callback function and usage string. The callback function will be called every time "--{name}" (or any form that matches the flag) is parsed on the command line.

(name string, usage string, fn func(string) error)

Source from the content-addressed store, hash-verified

31// The callback function will be called every time "--{name}" (or any form that matches the flag) is parsed
32// on the command line.
33func BoolFunc(name string, usage string, fn func(string) error) {
34 CommandLine.BoolFuncP(name, "", usage, fn)
35}
36
37// BoolFuncP is like BoolFunc, but accepts a shorthand letter that can be used after a single dash.
38func BoolFuncP(name, shorthand string, usage string, fn func(string) error) {

Callers

nothing calls this directly

Calls 1

BoolFuncPMethod · 0.80

Tested by

no test coverage detected