diff --git a/cli/cmd/root.go b/cli/cmd/root.go index 549b45293..2c4df390e 100644 --- a/cli/cmd/root.go +++ b/cli/cmd/root.go @@ -10,10 +10,10 @@ import ( ) var rootCmd = &cobra.Command{ - Use: "constellation", - Short: "Manage your Constellation cluster", - Long: "Manage your Constellation cluster.", - SilenceUsage: true, + Use: "constellation", + Short: "Manage your Constellation cluster", + Long: "Manage your Constellation cluster.", + PersistentPreRun: preRunRoot, } // Execute starts the CLI. @@ -64,6 +64,10 @@ func init() { rootCmd.AddCommand(newVersionCmd()) } +func preRunRoot(cmd *cobra.Command, args []string) { + cmd.SilenceUsage = true +} + func must(err error) { if err != nil { panic(err)