Skip to content

Commit

Permalink
Don't show usage every time there's an error
Browse files Browse the repository at this point in the history
Showing the usage implies that the parameters were invalid hence
it's very confusing.

(From spf13/cobra#340 it appears that this
is a popular opinion.)

JIRA: HACBS-837
  • Loading branch information
simonbaird committed Jul 7, 2022
1 parent 46f6f90 commit 3c13d79
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ var rootCmd = &cobra.Command{
Use: "ec",
Short: "Tool to enforce enterprise contracts",
Long: `TODO: description`,

// Prevent usage instructions showing on every error
SilenceUsage: true,
}

const globalTimeout = 5 * time.Minute
Expand Down

0 comments on commit 3c13d79

Please sign in to comment.