Skip to content

Commit

Permalink
prevent printing usages on error (#457)
Browse files Browse the repository at this point in the history
Signed-off-by: Manabu McCloskey <[email protected]>
  • Loading branch information
nabuskey authored Nov 22, 2024
1 parent d14289a commit 4d9f1a0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 19 deletions.
11 changes: 6 additions & 5 deletions pkg/cmd/create/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ var (
)

var CreateCmd = &cobra.Command{
Use: "create",
Short: "(Re)Create an IDP cluster",
Long: ``,
RunE: create,
PreRunE: preCreateE,
Use: "create",
Short: "(Re)Create an IDP cluster",
Long: ``,
RunE: create,
PreRunE: preCreateE,
SilenceUsage: true,
}

func init() {
Expand Down
11 changes: 6 additions & 5 deletions pkg/cmd/delete/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ var (
)

var DeleteCmd = &cobra.Command{
Use: "delete",
Short: "Delete an IDP cluster",
Long: ``,
RunE: deleteE,
PreRunE: preDeleteE,
Use: "delete",
Short: "Delete an IDP cluster",
Long: ``,
RunE: deleteE,
PreRunE: preDeleteE,
SilenceUsage: true,
}

func init() {
Expand Down
11 changes: 6 additions & 5 deletions pkg/cmd/get/clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import (
)

var ClustersCmd = &cobra.Command{
Use: "clusters",
Short: "Get idp clusters",
Long: ``,
RunE: list,
PreRunE: preClustersE,
Use: "clusters",
Short: "Get idp clusters",
Long: ``,
RunE: list,
PreRunE: preClustersE,
SilenceUsage: true,
}

func preClustersE(cmd *cobra.Command, args []string) error {
Expand Down
9 changes: 5 additions & 4 deletions pkg/cmd/get/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ const (
var templates embed.FS

var SecretsCmd = &cobra.Command{
Use: "secrets",
Short: "retrieve secrets from the cluster",
Long: ``,
RunE: getSecretsE,
Use: "secrets",
Short: "retrieve secrets from the cluster",
Long: ``,
RunE: getSecretsE,
SilenceUsage: true,
}

// well known secrets that are part of the core packages
Expand Down

0 comments on commit 4d9f1a0

Please sign in to comment.