Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/instance_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ var instanceAccountCmd = &cobra.Command{
Long: `Rotate password and API key for the instance.`,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.Help()
cmd.SilenceUsage = true
return fmt.Errorf("subcommand required")
},
}
Expand Down
1 change: 1 addition & 0 deletions cmd/instance_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var instanceActionsCmd = &cobra.Command{
Long: `Restart, stop, start, reboot, and upgrade instance components.`,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.Help()
cmd.SilenceUsage = true
return fmt.Errorf("subcommand required")
},
}
Expand Down
1 change: 1 addition & 0 deletions cmd/instance_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var instanceConfigCmd = &cobra.Command{
Long: `Get and update RabbitMQ configuration settings for the instance.`,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.Help()
cmd.SilenceUsage = true
return fmt.Errorf("subcommand required")
},
}
Expand Down
4 changes: 4 additions & 0 deletions cmd/instance_manage.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ Instance API keys are automatically saved when you run 'cloudamqp instance get <
RunE: func(cmd *cobra.Command, args []string) error {
if len(args) == 0 {
cmd.Help()
cmd.SilenceUsage = true
return fmt.Errorf("instance ID is required")
}

if len(args) == 1 {
cmd.Help()
cmd.SilenceUsage = true
return fmt.Errorf("subcommand is required")
}

Expand Down Expand Up @@ -63,6 +65,7 @@ Instance API keys are automatically saved when you run 'cloudamqp instance get <
// If no RunE, show help for the subcommand
if len(subCmd.Commands()) > 0 {
subCmd.Help()
cmd.SilenceUsage = true
return fmt.Errorf("subcommand required for %s", subcommandName)
}

Expand All @@ -71,6 +74,7 @@ Instance API keys are automatically saved when you run 'cloudamqp instance get <
}

cmd.Help()
cmd.SilenceUsage = true
return fmt.Errorf("unknown subcommand: %s", subcommandName)
},
}
Expand Down
1 change: 1 addition & 0 deletions cmd/instance_nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var instanceNodesCmd = &cobra.Command{
Long: `List nodes and get available versions for the instance.`,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.Help()
cmd.SilenceUsage = true
return fmt.Errorf("subcommand required")
},
}
Expand Down
1 change: 1 addition & 0 deletions cmd/instance_plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var instancePluginsCmd = &cobra.Command{
Long: `List, enable, and disable RabbitMQ plugins for the instance.`,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.Help()
cmd.SilenceUsage = true
return fmt.Errorf("subcommand required")
},
}
Expand Down
Loading