diff --git a/command/help.go b/command/help.go index 87e302839..cf9b64b7a 100644 --- a/command/help.go +++ b/command/help.go @@ -95,6 +95,11 @@ func rootHelpFunc(command *cobra.Command, args []string) { dedent := regexp.MustCompile(`(?m)^ `) helpEntries = append(helpEntries, helpEntry{"FLAGS", dedent.ReplaceAllString(flagUsages, "")}) } + inheritedFlagUsages := command.InheritedFlags().FlagUsages() + if inheritedFlagUsages != "" { + dedent := regexp.MustCompile(`(?m)^ `) + helpEntries = append(helpEntries, helpEntry{"INHERITED FLAGS", dedent.ReplaceAllString(inheritedFlagUsages, "")}) + } if _, ok := command.Annotations["help:arguments"]; ok { helpEntries = append(helpEntries, helpEntry{"ARGUMENTS", command.Annotations["help:arguments"]}) }