From 7d7a010739bed4d1105998a4d9f9a58ef13f91ea Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Wed, 10 Jun 2020 09:43:24 -0700 Subject: [PATCH] Clear out usage func --- command/root.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/command/root.go b/command/root.go index 1b92ef86a..12979ad5f 100644 --- a/command/root.go +++ b/command/root.go @@ -59,6 +59,9 @@ func init() { RootCmd.SetHelpFunc(rootHelpFunc) + // This will silence the usage func on error + RootCmd.SetUsageFunc(func(_ *cobra.Command) error { return nil }) + RootCmd.SetFlagErrorFunc(func(cmd *cobra.Command, err error) error { if err == pflag.ErrHelp { return err