Skip to content

Commit

Permalink
Merge pull request #59 from dreid/dreid/silence-usage-on-cmd-err
Browse files Browse the repository at this point in the history
Silence usage on cmd error.  Fixes #45
  • Loading branch information
Paul Osman authored Feb 25, 2020
2 parents 19db0e9 + e076efa commit f212d8a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ will be launched via "bash -c" using "exec".`,
),
DisableFlagsInUseLine: true,
RunE: func(cmd *cobra.Command, args []string) error {
// Don't show usage if RunE returns an error. This set in RunE
// instead of when we instantiate the cmd so we don't suppress usage
// for errors from Args.
cmd.SilenceUsage = true

traceID := strings.TrimSpace(args[0])
stepID := strings.TrimSpace(args[1])
name := strings.TrimSpace(args[2])
Expand Down

0 comments on commit f212d8a

Please sign in to comment.