diff --git a/cli/cobra.go b/cli/cobra.go index 28e7005841..229303edab 100644 --- a/cli/cobra.go +++ b/cli/cobra.go @@ -372,11 +372,13 @@ Examples: {{ .Example }} {{- end}} +{{- if .HasParent}} {{- if .HasAvailableFlags}} Options: {{ wrappedFlagUsages . | trimRightSpace}} +{{- end}} {{- end}} {{- if hasManagementSubCommands . }} @@ -413,6 +415,14 @@ Invalid Plugins: {{rpad .Name .NamePadding }} {{invalidPluginReason .}} {{- end}} +{{- end}} +{{- if not .HasParent}} +{{- if .HasAvailableFlags}} + +Global Options: +{{ wrappedFlagUsages . | trimRightSpace}} + +{{- end}} {{- end}} {{- if .HasSubCommands }}