Add merging of CommandLine flags to Root command

This commit is contained in:
Albert Nigmatzianov
2017-04-19 10:49:22 +02:00
parent 37a4355faa
commit 458d79748e
2 changed files with 10 additions and 0 deletions

View File

@ -1258,6 +1258,8 @@ func (c *Command) updateParentsPflags() (added []*flag.Flag) {
c.parentsPflags.SortFlags = false
}
c.Root().PersistentFlags().AddFlagSet(flag.CommandLine)
c.VisitParents(func(x *Command) {
if x.HasPersistentFlags() {
x.PersistentFlags().VisitAll(func(f *flag.Flag) {