Skip to content

Commit 7e32fdf

Browse files
authored
Merge pull request #6611 from thaJeztah/skip_hidden_plugin_commands
cli: allManagementSubCommands: improve handling of plugin stubs
2 parents b5bac44 + 259df25 commit 7e32fdf

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

cli/cobra.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,13 +350,10 @@ func orchestratorSubCommands(cmd *cobra.Command) []*cobra.Command {
350350
func allManagementSubCommands(cmd *cobra.Command) []*cobra.Command {
351351
cmds := []*cobra.Command{}
352352
for _, sub := range cmd.Commands() {
353-
if isPlugin(sub) {
354-
if invalidPluginReason(sub) == "" {
355-
cmds = append(cmds, sub)
356-
}
353+
if invalidPluginReason(sub) != "" {
357354
continue
358355
}
359-
if sub.IsAvailableCommand() && sub.HasSubCommands() {
356+
if sub.IsAvailableCommand() && (isPlugin(sub) || sub.HasSubCommands()) {
360357
cmds = append(cmds, sub)
361358
}
362359
}

0 commit comments

Comments
 (0)