Fix FLAGS section showing up empty for config get/set
This is because `config get/set` both do have a flag, but it's hidden.
This commit is contained in:
parent
e6a0c3dc28
commit
99fce24fc8
1 changed files with 3 additions and 2 deletions
|
|
@ -78,8 +78,9 @@ func rootHelpFunc(command *cobra.Command, args []string) {
|
|||
if len(additionalCommands) > 0 {
|
||||
helpEntries = append(helpEntries, helpEntry{"ADDITIONAL COMMANDS", strings.Join(additionalCommands, "\n")})
|
||||
}
|
||||
if command.HasLocalFlags() {
|
||||
helpEntries = append(helpEntries, helpEntry{"FLAGS", strings.TrimRight(command.LocalFlags().FlagUsages(), "\n")})
|
||||
flagUsages := strings.TrimRight(command.LocalFlags().FlagUsages(), "\n")
|
||||
if flagUsages != "" {
|
||||
helpEntries = append(helpEntries, helpEntry{"FLAGS", flagUsages})
|
||||
}
|
||||
if _, ok := command.Annotations["help:arguments"]; ok {
|
||||
helpEntries = append(helpEntries, helpEntry{"ARGUMENTS", command.Annotations["help:arguments"]})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue