Fix flag template when both visible and explicit flags are specified

This commit is contained in:
Maciej Szulik 2019-02-27 22:35:03 +01:00
parent b2e9b2a842
commit b4f81285bf
No known key found for this signature in database
GPG Key ID: F15E55D276FA84C4

View File

@ -49,7 +49,8 @@ const (
// SectionFlags is the help template section that displays the command's flags. // SectionFlags is the help template section that displays the command's flags.
SectionFlags = `{{ if or $visibleFlags.HasFlags $explicitlyExposedFlags.HasFlags}}Options: 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}}` {{end}}`