Skip to content

Commit 7d7a010

Browse files
committed
Clear out usage func
1 parent 4931892 commit 7d7a010

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

command/root.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ func init() {
5959

6060
RootCmd.SetHelpFunc(rootHelpFunc)
6161

62+
// This will silence the usage func on error
63+
RootCmd.SetUsageFunc(func(_ *cobra.Command) error { return nil })
64+
6265
RootCmd.SetFlagErrorFunc(func(cmd *cobra.Command, err error) error {
6366
if err == pflag.ErrHelp {
6467
return err

0 commit comments

Comments
 (0)