Skip to content

Commit

Permalink
Properly return command errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmcconnell committed Mar 20, 2024
1 parent 598303b commit 5d41e63
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions internal/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ var globalConfig server.Config

// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "mproxy",
Short: "HTTP proxy for zero downtime deployments",
Use: "mproxy",
Short: "HTTP proxy for zero downtime deployments",
SilenceUsage: true,
}

func Execute() {
Expand All @@ -26,7 +27,11 @@ func Execute() {
rootCmd.AddCommand(newDeployCommand().cmd)
rootCmd.AddCommand(newRemoveCommand().cmd)
rootCmd.AddCommand(newListCommand().cmd)
rootCmd.Execute()

err := rootCmd.Execute()
if err != nil {
os.Exit(1)
}
}

func defaultConfigLocation() string {
Expand Down

0 comments on commit 5d41e63

Please sign in to comment.