Skip to content

Commit 1a4b5b2

Browse files
committed
fix discrepancy in order of arguments for Func() and BoolFunc() #433
for no good reason: the order of arguments would differ when calling pflag.BoolFuncP(...) and (*FlagSet).BoolFuncP(...) (same goes for Func() and FuncP()) in this commit: align all functions on stdlib's order fixes #433
1 parent 4730aa0 commit 1a4b5b2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

bool_func.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ func BoolFunc(name string, usage string, fn func(string) error) {
3535
}
3636

3737
// BoolFuncP is like BoolFunc, but accepts a shorthand letter that can be used after a single dash.
38-
func BoolFuncP(name, shorthand string, fn func(string) error, usage string) {
38+
func BoolFuncP(name, shorthand string, usage string, fn func(string) error) {
3939
CommandLine.BoolFuncP(name, shorthand, usage, fn)
4040
}

func.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ func (f *FlagSet) FuncP(name string, shorthand string, usage string, fn func(str
2727
//
2828
// The callback function will be called every time "--{name}={value}" (or equivalent) is
2929
// parsed on the command line, with "{value}" as an argument.
30-
func Func(name string, fn func(string) error, usage string) {
30+
func Func(name string, usage string, fn func(string) error) {
3131
CommandLine.FuncP(name, "", usage, fn)
3232
}
3333

3434
// FuncP is like Func, but accepts a shorthand letter that can be used after a single dash.
35-
func FuncP(name, shorthand string, fn func(string) error, usage string) {
35+
func FuncP(name, shorthand string, usage string, fn func(string) error) {
3636
CommandLine.FuncP(name, shorthand, usage, fn)
3737
}

0 commit comments

Comments
 (0)