From 0b7cdbd700851a013be3377ac0790dcf2be201f1 Mon Sep 17 00:00:00 2001 From: Gabriel Krenn Date: Tue, 21 Jan 2025 10:29:31 +0100 Subject: [PATCH] Remove command descriptions in case the whole application is failing (#4290) --- cmd/csi/init/cmd.go | 5 +++-- cmd/csi/provisioner/cmd.go | 5 +++-- cmd/csi/server/cmd.go | 5 +++-- cmd/operator/builder.go | 5 +++-- cmd/standalone/standalone.go | 5 +++-- cmd/webhook/builder.go | 5 +++-- 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/cmd/csi/init/cmd.go b/cmd/csi/init/cmd.go index 04f8436b67..3d97d07ca7 100644 --- a/cmd/csi/init/cmd.go +++ b/cmd/csi/init/cmd.go @@ -25,8 +25,9 @@ var nodeId, endpoint string func New() *cobra.Command { cmd := &cobra.Command{ - Use: use, - RunE: run(), + Use: use, + RunE: run(), + SilenceUsage: true, } return cmd diff --git a/cmd/csi/provisioner/cmd.go b/cmd/csi/provisioner/cmd.go index ab9cad5602..3330336f55 100644 --- a/cmd/csi/provisioner/cmd.go +++ b/cmd/csi/provisioner/cmd.go @@ -35,8 +35,9 @@ var probeAddress string func New() *cobra.Command { cmd := &cobra.Command{ - Use: use, - RunE: run(), + Use: use, + RunE: run(), + SilenceUsage: true, } addFlags(cmd) diff --git a/cmd/csi/server/cmd.go b/cmd/csi/server/cmd.go index 5ac83bedf5..1d7e6f731f 100644 --- a/cmd/csi/server/cmd.go +++ b/cmd/csi/server/cmd.go @@ -31,8 +31,9 @@ var nodeId, endpoint string func New() *cobra.Command { cmd := &cobra.Command{ - Use: use, - RunE: run(), + Use: use, + RunE: run(), + SilenceUsage: true, } addFlags(cmd) diff --git a/cmd/operator/builder.go b/cmd/operator/builder.go index f6b3ae1b0e..195c97629e 100644 --- a/cmd/operator/builder.go +++ b/cmd/operator/builder.go @@ -104,8 +104,9 @@ func (builder *CommandBuilder) getSignalHandler() context.Context { func (builder CommandBuilder) Build() *cobra.Command { return &cobra.Command{ - Use: use, - RunE: builder.buildRun(), + Use: use, + RunE: builder.buildRun(), + SilenceUsage: true, } } diff --git a/cmd/standalone/standalone.go b/cmd/standalone/standalone.go index 6c87bd5e33..4ba18ae6c6 100644 --- a/cmd/standalone/standalone.go +++ b/cmd/standalone/standalone.go @@ -14,8 +14,9 @@ const ( func NewStandaloneCommand() *cobra.Command { return &cobra.Command{ - Use: use, - RunE: startStandAloneInit, + Use: use, + RunE: startStandAloneInit, + SilenceUsage: true, } } diff --git a/cmd/webhook/builder.go b/cmd/webhook/builder.go index 9ca9d7eb93..b0a07d1669 100644 --- a/cmd/webhook/builder.go +++ b/cmd/webhook/builder.go @@ -84,8 +84,9 @@ func (builder CommandBuilder) SetPodName(podName string) CommandBuilder { func (builder CommandBuilder) Build() *cobra.Command { cmd := &cobra.Command{ - Use: use, - RunE: builder.buildRun(), + Use: use, + RunE: builder.buildRun(), + SilenceUsage: true, } addFlags(cmd)