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)
| 31 | // The callback function will be called every time "--{name}" (or any form that matches the flag) is parsed |
| 32 | // on the command line. |
| 33 | func 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. |
| 38 | func BoolFuncP(name, shorthand string, usage string, fn func(string) error) { |