Merge pull request #286 from dnephin/merge_flags_before_adding_help
Merge persistent flags before checking for a help flag
This commit is contained in:
@ -735,6 +735,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())
|
||||
}
|
||||
|
Reference in New Issue
Block a user