diff --git a/cli/parameters.go b/cli/parameters.go index 3f02ea989e6ee..3fb54973ab98b 100644 --- a/cli/parameters.go +++ b/cli/parameters.go @@ -20,6 +20,9 @@ func parameters() *cobra.Command { // constructing curl requests. Hidden: true, Aliases: []string{"params"}, + RunE: func(cmd *cobra.Command, args []string) error { + return cmd.Help() + }, } cmd.AddCommand( parameterList(), diff --git a/cli/schedule.go b/cli/schedule.go index 1e6b5b274bb6c..f774f5a51ad87 100644 --- a/cli/schedule.go +++ b/cli/schedule.go @@ -58,6 +58,9 @@ func schedules() *cobra.Command { Annotations: workspaceCommand, Use: "schedule { show | start | stop | override } ", Short: "Schedule automated start and stop times for workspaces", + RunE: func(cmd *cobra.Command, args []string) error { + return cmd.Help() + }, } scheduleCmd.AddCommand( diff --git a/cli/state.go b/cli/state.go index 9564b9746cf83..6a5858db704d7 100644 --- a/cli/state.go +++ b/cli/state.go @@ -17,6 +17,9 @@ func state() *cobra.Command { cmd := &cobra.Command{ Use: "state", Short: "Manually manage Terraform state to fix broken workspaces", + RunE: func(cmd *cobra.Command, args []string) error { + return cmd.Help() + }, } cmd.AddCommand(statePull(), statePush()) return cmd diff --git a/cli/templates.go b/cli/templates.go index 5e18d4d188e27..4c85606d70c6f 100644 --- a/cli/templates.go +++ b/cli/templates.go @@ -30,6 +30,9 @@ func templates() *cobra.Command { Command: "coder templates push my-template", }, ), + RunE: func(cmd *cobra.Command, args []string) error { + return cmd.Help() + }, } cmd.AddCommand( templateCreate(), diff --git a/cli/templateversions.go b/cli/templateversions.go index 5c27970d6bedd..c5111d0a16e17 100644 --- a/cli/templateversions.go +++ b/cli/templateversions.go @@ -24,6 +24,9 @@ func templateVersions() *cobra.Command { Command: "coder templates versions list my-template", }, ), + RunE: func(cmd *cobra.Command, args []string) error { + return cmd.Help() + }, } cmd.AddCommand( templateVersionsList(), diff --git a/cli/tokens.go b/cli/tokens.go index 3ad22f14f2ca9..6941116ee6060 100644 --- a/cli/tokens.go +++ b/cli/tokens.go @@ -32,6 +32,9 @@ func tokens() *cobra.Command { Command: "coder tokens rm WuoWs4ZsMX", }, ), + RunE: func(cmd *cobra.Command, args []string) error { + return cmd.Help() + }, } cmd.AddCommand( createToken(), diff --git a/cli/users.go b/cli/users.go index 3c8368e4d1b10..c292a7841cd0d 100644 --- a/cli/users.go +++ b/cli/users.go @@ -11,6 +11,9 @@ func users() *cobra.Command { Short: "Manage users", Use: "users", Aliases: []string{"user"}, + RunE: func(cmd *cobra.Command, args []string) error { + return cmd.Help() + }, } cmd.AddCommand( userCreate(), diff --git a/enterprise/cli/features.go b/enterprise/cli/features.go index 7a56c6ba2e538..b0ced1277caac 100644 --- a/enterprise/cli/features.go +++ b/enterprise/cli/features.go @@ -21,6 +21,9 @@ func features() *cobra.Command { Short: "List Enterprise features", Use: "features", Aliases: []string{"feature"}, + RunE: func(cmd *cobra.Command, args []string) error { + return cmd.Help() + }, } cmd.AddCommand( featuresList(),