aboutsummaryrefslogtreecommitdiff
path: root/func.go
diff options
context:
space:
mode:
authorTomas Aschan <[email protected]>2025-06-28 11:26:14 +0200
committerGitHub <[email protected]>2025-06-28 11:26:14 +0200
commit1c62fb2813da5f1d1b893a49180a41b3f6be3262 (patch)
tree289c9ab56575327b848a6dae879737cf9b1edb4d /func.go
parent8a6c85f2ae488081f953744f9edc414bac10ee45 (diff)
parent1a4b5b2e5c7ee4a194cebc579bb34198187df73d (diff)
Merge pull request #431 from LeGEC/430-fix-usage-message-for-func-flags
fix usage message for func flags, fix arguments order
Diffstat (limited to 'func.go')
-rw-r--r--func.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/func.go b/func.go
index e5f5436..9f4d88f 100644
--- a/func.go
+++ b/func.go
@@ -27,11 +27,11 @@ func (f *FlagSet) FuncP(name string, shorthand string, usage string, fn func(str
//
// The callback function will be called every time "--{name}={value}" (or equivalent) is
// parsed on the command line, with "{value}" as an argument.
-func Func(name string, fn func(string) error, usage string) {
+func Func(name string, usage string, fn func(string) error) {
CommandLine.FuncP(name, "", usage, fn)
}
// FuncP is like Func, but accepts a shorthand letter that can be used after a single dash.
-func FuncP(name, shorthand string, fn func(string) error, usage string) {
+func FuncP(name, shorthand string, usage string, fn func(string) error) {
CommandLine.FuncP(name, shorthand, usage, fn)
}