diff --git a/cmd/cluster/create.go b/cmd/cluster/create.go index f84fd1bb87..f31fc3d282 100644 --- a/cmd/cluster/create.go +++ b/cmd/cluster/create.go @@ -46,8 +46,9 @@ type Options struct { func NewCreateCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "cluster", - Short: "Creates basic functional HostedCluster resources", + Use: "cluster", + Short: "Creates basic functional HostedCluster resources", + SilenceUsage: true, } var releaseImage string diff --git a/cmd/cluster/destroy.go b/cmd/cluster/destroy.go index 420aec7af3..4065fe9bb7 100644 --- a/cmd/cluster/destroy.go +++ b/cmd/cluster/destroy.go @@ -33,8 +33,9 @@ type DestroyOptions struct { func NewDestroyCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "cluster", - Short: "Destroys a HostedCluster and its associated infrastructure.", + Use: "cluster", + Short: "Destroys a HostedCluster and its associated infrastructure.", + SilenceUsage: true, } opts := DestroyOptions{ diff --git a/cmd/cluster/dump.go b/cmd/cluster/dump.go index 106cc7338f..fd4b20afcf 100644 --- a/cmd/cluster/dump.go +++ b/cmd/cluster/dump.go @@ -34,8 +34,9 @@ type DumpOptions struct { func NewDumpCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "cluster", - Short: "Creates basic functional HostedCluster resources", + Use: "cluster", + Short: "Creates basic functional HostedCluster resources", + SilenceUsage: true, } opts := &DumpOptions{ diff --git a/cmd/create/create.go b/cmd/create/create.go index e3aeeb24dd..f6cd6c4887 100644 --- a/cmd/create/create.go +++ b/cmd/create/create.go @@ -11,8 +11,9 @@ import ( func NewCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "create", - Short: "Commands for creating HyperShift resources", + Use: "create", + Short: "Commands for creating HyperShift resources", + SilenceUsage: true, } cmd.AddCommand(cluster.NewCreateCommand()) diff --git a/cmd/destroy/destroy.go b/cmd/destroy/destroy.go index bada05c7d7..8be932e23a 100644 --- a/cmd/destroy/destroy.go +++ b/cmd/destroy/destroy.go @@ -9,8 +9,9 @@ import ( func NewCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "destroy", - Short: "Commands for destroying HyperShift resources", + Use: "destroy", + Short: "Commands for destroying HyperShift resources", + SilenceUsage: true, } cmd.AddCommand(infra.NewDestroyCommand()) diff --git a/cmd/dump/dump.go b/cmd/dump/dump.go index 6a3870997c..7cf8637a06 100644 --- a/cmd/dump/dump.go +++ b/cmd/dump/dump.go @@ -8,8 +8,9 @@ import ( func NewCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "dump", - Short: "Commands for dumping resources for debugging", + Use: "dump", + Short: "Commands for dumping resources for debugging", + SilenceUsage: true, } cmd.AddCommand(cluster.NewDumpCommand()) diff --git a/cmd/infra/aws/create.go b/cmd/infra/aws/create.go index 46baa0ead7..8c991c6e4e 100644 --- a/cmd/infra/aws/create.go +++ b/cmd/infra/aws/create.go @@ -54,8 +54,9 @@ const ( func NewCreateCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "aws", - Short: "Creates AWS infrastructure resources for a cluster", + Use: "aws", + Short: "Creates AWS infrastructure resources for a cluster", + SilenceUsage: true, } opts := CreateInfraOptions{ diff --git a/cmd/infra/aws/create_iam.go b/cmd/infra/aws/create_iam.go index 7c034221a9..864dd4c6a0 100644 --- a/cmd/infra/aws/create_iam.go +++ b/cmd/infra/aws/create_iam.go @@ -43,8 +43,9 @@ type CreateIAMOutput struct { func NewCreateIAMCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "aws", - Short: "Creates AWS instance profile for workers", + Use: "aws", + Short: "Creates AWS instance profile for workers", + SilenceUsage: true, } opts := CreateIAMOptions{ diff --git a/cmd/infra/aws/destroy.go b/cmd/infra/aws/destroy.go index c6c4a37e04..11ea19fc28 100644 --- a/cmd/infra/aws/destroy.go +++ b/cmd/infra/aws/destroy.go @@ -30,8 +30,9 @@ type DestroyInfraOptions struct { func NewDestroyCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "aws", - Short: "Destroys AWS infrastructure resources for a cluster", + Use: "aws", + Short: "Destroys AWS infrastructure resources for a cluster", + SilenceUsage: true, } opts := DestroyInfraOptions{ diff --git a/cmd/infra/aws/destroy_iam.go b/cmd/infra/aws/destroy_iam.go index 798d1749ed..508bcec759 100644 --- a/cmd/infra/aws/destroy_iam.go +++ b/cmd/infra/aws/destroy_iam.go @@ -27,8 +27,9 @@ type DestroyIAMOptions struct { func NewDestroyIAMCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "aws", - Short: "Destroys AWS instance profile for workers", + Use: "aws", + Short: "Destroys AWS instance profile for workers", + SilenceUsage: true, } opts := DestroyIAMOptions{ diff --git a/cmd/infra/create.go b/cmd/infra/create.go index 95b5c8d817..33a0425156 100644 --- a/cmd/infra/create.go +++ b/cmd/infra/create.go @@ -8,8 +8,9 @@ import ( func NewCreateCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "infra", - Short: "Commands for creating HyperShift infra resources", + Use: "infra", + Short: "Commands for creating HyperShift infra resources", + SilenceUsage: true, } cmd.AddCommand(aws.NewCreateCommand()) diff --git a/cmd/infra/create_iam.go b/cmd/infra/create_iam.go index a7f8ebb54a..20eb78c019 100644 --- a/cmd/infra/create_iam.go +++ b/cmd/infra/create_iam.go @@ -8,8 +8,9 @@ import ( func NewCreateIAMCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "iam", - Short: "Commands for creating HyperShift IAM resources", + Use: "iam", + Short: "Commands for creating HyperShift IAM resources", + SilenceUsage: true, } cmd.AddCommand(aws.NewCreateIAMCommand()) diff --git a/cmd/infra/destroy.go b/cmd/infra/destroy.go index 4e2378e51e..4551231cc1 100644 --- a/cmd/infra/destroy.go +++ b/cmd/infra/destroy.go @@ -8,8 +8,9 @@ import ( func NewDestroyCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "infra", - Short: "Commands for destroying HyperShift infra resources", + Use: "infra", + Short: "Commands for destroying HyperShift infra resources", + SilenceUsage: true, } cmd.AddCommand(aws.NewDestroyCommand()) diff --git a/cmd/infra/destroy_iam.go b/cmd/infra/destroy_iam.go index ea22b7abe6..cba30ffa91 100644 --- a/cmd/infra/destroy_iam.go +++ b/cmd/infra/destroy_iam.go @@ -8,8 +8,9 @@ import ( func NewDestroyIAMCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "iam", - Short: "Commands for destroying HyperShift IAM resources", + Use: "iam", + Short: "Commands for destroying HyperShift IAM resources", + SilenceUsage: true, } cmd.AddCommand(aws.NewDestroyIAMCommand()) diff --git a/cmd/install/install.go b/cmd/install/install.go index f2719b2e1f..1783bd2bb4 100644 --- a/cmd/install/install.go +++ b/cmd/install/install.go @@ -41,8 +41,9 @@ type Options struct { func NewCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "install", - Short: "Installs the HyperShift operator", + Use: "install", + Short: "Installs the HyperShift operator", + SilenceUsage: true, } var opts Options diff --git a/cmd/kubeconfig/create.go b/cmd/kubeconfig/create.go index 703cd87601..a0e108f9c9 100644 --- a/cmd/kubeconfig/create.go +++ b/cmd/kubeconfig/create.go @@ -37,9 +37,10 @@ of the HostedCluster itself. // from HostedCluster resources. func NewCreateCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "kubeconfig", - Short: "Creates a combined kubeconfig from hostedcluster resources", - Long: description, + Use: "kubeconfig", + Short: "Creates a combined kubeconfig from hostedcluster resources", + Long: description, + SilenceUsage: true, } cmd.RunE = func(cmd *cobra.Command, args []string) error { diff --git a/cmd/nodepool/create.go b/cmd/nodepool/create.go index dbca63b6b7..df03dc3ccd 100644 --- a/cmd/nodepool/create.go +++ b/cmd/nodepool/create.go @@ -29,8 +29,9 @@ type CreateNodePoolOptions struct { func NewCreateCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "nodepool", - Short: "Create a HyperShift NodePool", + Use: "nodepool", + Short: "Create a HyperShift NodePool", + SilenceUsage: true, } opts := CreateNodePoolOptions{ diff --git a/main.go b/main.go index 67627c5fdf..fc1cd9908a 100644 --- a/main.go +++ b/main.go @@ -30,7 +30,8 @@ import ( func main() { cmd := &cobra.Command{ - Use: "hypershift", + Use: "hypershift", + SilenceUsage: true, Run: func(cmd *cobra.Command, args []string) { cmd.Help() os.Exit(1)