Skip to content

Commit

Permalink
Add SilenceError and move changes to root cobra command
Browse files Browse the repository at this point in the history
  • Loading branch information
bjee19 committed Nov 10, 2023
1 parent af4ceb6 commit 4d6a7e7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/gateway/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ const (

func createRootCommand() *cobra.Command {
rootCmd := &cobra.Command{
Use: "gateway",
Use: "gateway",
SilenceUsage: true,
SilenceErrors: true,
RunE: func(cmd *cobra.Command, args []string) error {
return cmd.Help()
},
Expand Down Expand Up @@ -93,9 +95,8 @@ func createStaticModeCommand() *cobra.Command {
)

cmd := &cobra.Command{
Use: "static-mode",
Short: "Configure NGINX in the scope of a single Gateway resource",
SilenceUsage: true,
Use: "static-mode",
Short: "Configure NGINX in the scope of a single Gateway resource",
RunE: func(cmd *cobra.Command, args []string) error {
atom := zap.NewAtomicLevel()

Expand Down

0 comments on commit 4d6a7e7

Please sign in to comment.