diff --git a/cli/cmd/customer_create.go b/cli/cmd/customer_create.go index 4614c74e..1bcfc4f4 100644 --- a/cli/cmd/customer_create.go +++ b/cli/cmd/customer_create.go @@ -19,7 +19,7 @@ func (r *runners) InitCustomersCreateCommand(parent *cobra.Command) *cobra.Comma Long: `create a customer`, RunE: r.createCustomer, SilenceUsage: false, - SilenceErrors: true, // this command uses custom error printing + SilenceErrors: false, } parent.AddCommand(cmd) cmd.Flags().StringVar(&r.args.customerCreateName, "name", "", "Name of the customer") @@ -48,6 +48,8 @@ func (r *runners) InitCustomersCreateCommand(parent *cobra.Command) *cobra.Comma } func (r *runners) createCustomer(cmd *cobra.Command, _ []string) (err error) { + cmd.SilenceErrors = true // this command uses custom error printing + defer func() { printIfError(cmd, err) }() diff --git a/cli/cmd/customer_update.go b/cli/cmd/customer_update.go index e77c8a6e..136ccb87 100644 --- a/cli/cmd/customer_update.go +++ b/cli/cmd/customer_update.go @@ -19,7 +19,7 @@ func (r *runners) InitCustomerUpdateCommand(parent *cobra.Command) *cobra.Comman Long: `update a customer`, RunE: r.updateCustomer, SilenceUsage: false, - SilenceErrors: true, // this command uses custom error printing + SilenceErrors: false, } parent.AddCommand(cmd) cmd.Flags().StringVar(&r.args.customerUpdateID, "customer", "", "The ID of the customer to update") @@ -50,6 +50,8 @@ func (r *runners) InitCustomerUpdateCommand(parent *cobra.Command) *cobra.Comman } func (r *runners) updateCustomer(cmd *cobra.Command, _ []string) (err error) { + cmd.SilenceErrors = true // this command uses custom error printing + defer func() { printIfError(cmd, err) }() diff --git a/cli/cmd/instance_inspect.go b/cli/cmd/instance_inspect.go index 2da30a75..7e81f14e 100644 --- a/cli/cmd/instance_inspect.go +++ b/cli/cmd/instance_inspect.go @@ -14,7 +14,7 @@ func (r *runners) InitInstanceInspectCommand(parent *cobra.Command) *cobra.Comma Long: `Show full details for a customer instance`, RunE: r.inspectInstance, SilenceUsage: false, - SilenceErrors: true, // this command uses custom error printing + SilenceErrors: false, } parent.AddCommand(cmd) cmd.Flags().StringVar(&r.args.instanceInspectCustomer, "customer", "", "Customer Name or ID") @@ -25,6 +25,8 @@ func (r *runners) InitInstanceInspectCommand(parent *cobra.Command) *cobra.Comma } func (r *runners) inspectInstance(cmd *cobra.Command, _ []string) (err error) { + cmd.SilenceErrors = true // this command uses custom error printing + defer func() { printIfError(cmd, err) }() diff --git a/cli/cmd/instance_ls.go b/cli/cmd/instance_ls.go index ac015c4e..57b86618 100644 --- a/cli/cmd/instance_ls.go +++ b/cli/cmd/instance_ls.go @@ -13,7 +13,7 @@ func (r *runners) InitInstanceLSCommand(parent *cobra.Command) *cobra.Command { Long: `list customer instances`, RunE: r.listInstances, SilenceUsage: false, - SilenceErrors: true, // this command uses custom error printing + SilenceErrors: false, } parent.AddCommand(cmd) @@ -25,6 +25,8 @@ func (r *runners) InitInstanceLSCommand(parent *cobra.Command) *cobra.Command { } func (r *runners) listInstances(cmd *cobra.Command, _ []string) (err error) { + cmd.SilenceErrors = true // this command uses custom error printing + defer func() { printIfError(cmd, err) }() diff --git a/cli/cmd/release_create.go b/cli/cmd/release_create.go index a781554c..d75f483d 100644 --- a/cli/cmd/release_create.go +++ b/cli/cmd/release_create.go @@ -33,7 +33,7 @@ func (r *runners) InitReleaseCreate(parent *cobra.Command) error { Long: `Create a new release by providing YAML configuration for the next release in your sequence.`, SilenceUsage: false, - SilenceErrors: true, // this command uses custom error printing + SilenceErrors: false, } parent.AddCommand(cmd) @@ -154,6 +154,8 @@ func (r *runners) setKOTSDefaultReleaseParams() error { } func (r *runners) releaseCreate(cmd *cobra.Command, args []string) (err error) { + cmd.SilenceErrors = true // this command uses custom error printing + defer func() { printIfError(cmd, err) }() diff --git a/cli/cmd/release_promote.go b/cli/cmd/release_promote.go index fafc7380..891cec0d 100644 --- a/cli/cmd/release_promote.go +++ b/cli/cmd/release_promote.go @@ -16,7 +16,7 @@ func (r *runners) InitReleasePromote(parent *cobra.Command) { Long: `Set the release for a channel Example: replicated release promote 15 fe4901690971757689f022f7a460f9b2`, - SilenceErrors: true, // this command uses custom error printing + SilenceErrors: false, } parent.AddCommand(cmd) @@ -30,6 +30,8 @@ func (r *runners) InitReleasePromote(parent *cobra.Command) { } func (r *runners) releasePromote(cmd *cobra.Command, args []string) (err error) { + cmd.SilenceErrors = true // this command uses custom error printing + defer func() { printIfError(cmd, err) }()