From 1730486b061565a339dfe2919156e4df8d62f497 Mon Sep 17 00:00:00 2001 From: Bilal Amarni Date: Sun, 8 Jul 2018 20:50:07 +0200 Subject: [PATCH] Disable usage output on errors This causes command help messages to appear everytime an error is triggered. --- pkg/cmd/dcos.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/dcos.go b/pkg/cmd/dcos.go index cf272d233..96f46a4c2 100644 --- a/pkg/cmd/dcos.go +++ b/pkg/cmd/dcos.go @@ -19,7 +19,8 @@ const annotationUsageOptions string = "usage_options" func NewDCOSCommand(ctx api.Context) *cobra.Command { var verbose int cmd := &cobra.Command{ - Use: "dcos", + Use: "dcos", + SilenceUsage: true, PersistentPreRun: func(cmd *cobra.Command, args []string) { if verbose == 1 { // -v sets the logger level to info. @@ -91,7 +92,6 @@ func pluginCommand(executable string, pluginManager *plugin.Manager, c *plugin.C Short: c.Description, DisableFlagParsing: true, SilenceErrors: true, // Silences error message if command returns an exit code. - SilenceUsage: true, // Silences usage information from the wrapper CLI on error. RunE: func(cmd *cobra.Command, args []string) error { // Prepend the arguments with the commands name so that the // executed command knows which subcommand to execute (e.g.