From b4f81285bf0b8d86c82f311ea0127cb1a2656548 Mon Sep 17 00:00:00 2001 From: Maciej Szulik Date: Wed, 27 Feb 2019 22:35:03 +0100 Subject: [PATCH] Fix flag template when both visible and explicit flags are specified --- pkg/kubectl/util/templates/templates.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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}}`