Skip to content

Commit

Permalink
don't print usage when any error is encountered (#49)
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Hall <[email protected]>
  • Loading branch information
imjasonh authored Jan 23, 2025
1 parent ddb5a1a commit 5e99932
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/gobump/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ var rootFlags rootCLIFlags

// rootCmd represents the base command when called without any subcommands.
var rootCmd = &cobra.Command{
Use: "gobump",
Short: "gobump cli",
Args: cobra.NoArgs,
Use: "gobump",
Short: "gobump cli",
Args: cobra.NoArgs,
SilenceUsage: true,
RunE: func(_ *cobra.Command, _ []string) error {
if rootFlags.packages == "" && rootFlags.replaces == "" && rootFlags.bumpFile == "" {
return fmt.Errorf("no packages or replaces provided. Use --packages or --replaces or --bump-file")
Expand Down

0 comments on commit 5e99932

Please sign in to comment.