diff --git a/pkg/kubectl/util/templates/templates.go b/pkg/kubectl/util/templates/templates.go index c40908f9f60..9f3b75b57ee 100644 --- a/pkg/kubectl/util/templates/templates.go +++ b/pkg/kubectl/util/templates/templates.go @@ -49,7 +49,8 @@ const ( // SectionFlags is the help template section that displays the command's flags. SectionFlags = `{{ if or $visibleFlags.HasFlags $explicitlyExposedFlags.HasFlags}}Options: -{{ if $visibleFlags.HasFlags}}{{trimRight (flagsUsages $visibleFlags)}}{{end}}{{ if $explicitlyExposedFlags.HasFlags}}{{trimRight (flagsUsages $explicitlyExposedFlags)}}{{end}} +{{ if $visibleFlags.HasFlags}}{{trimRight (flagsUsages $visibleFlags)}}{{end}}{{ if $explicitlyExposedFlags.HasFlags}}{{ if $visibleFlags.HasFlags}} +{{end}}{{trimRight (flagsUsages $explicitlyExposedFlags)}}{{end}} {{end}}`