Skip to content

Commit

Permalink
Disable usage output on errors
Browse files Browse the repository at this point in the history
This causes command help messages to appear everytime an error is triggered.
  • Loading branch information
bamarni committed Jul 9, 2018
1 parent 1574786 commit b2965ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/cmd/dcos.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit b2965ad

Please sign in to comment.