Fix incorrect merge of pflag.CommandLine to cmd.Flags()

Fix #443
This commit is contained in:
Albert Nigmatzianov
2017-05-12 20:22:26 +02:00
parent 3454e0e28e
commit 7d22e77cce
3 changed files with 24 additions and 8 deletions

View File

@ -1275,8 +1275,8 @@ func (c *Command) Parent() *Command {
// mergePersistentFlags merges c.PersistentFlags() to c.Flags()
// and adds missing persistent flags of all parents.
func (c *Command) mergePersistentFlags() {
c.Flags().AddFlagSet(c.PersistentFlags())
c.updateParentsPflags()
c.Flags().AddFlagSet(c.PersistentFlags())
c.Flags().AddFlagSet(c.parentsPflags)
}