Merge persistent flags before checking for a help flag.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
Daniel Nephin
2016-05-31 15:38:12 -07:00
parent bc81c21bd0
commit 7faa7fcdd2
2 changed files with 16 additions and 0 deletions

View File

@ -684,6 +684,7 @@ func (c *Command) ExecuteC() (cmd *Command, err error) {
}
func (c *Command) initHelpFlag() {
c.mergePersistentFlags()
if c.Flags().Lookup("help") == nil {
c.Flags().BoolP("help", "h", false, "help for "+c.Name())
}