Skip to content
Myr

Merge pull request #75 from eparis/CommandLine

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Make flags declared outside spf13.pflag persistent flags on the parent

authored by Eric Paris · committed by Eric Paris · parents 69e5f19, f81b784 · Browse files · 1 file+7 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−0 removed

  • other:+7 added−0 removed

1 file+7 added−0 removed

modified:command.go+7 added
946 unmodified lines
947 c.Flags().VisitAll(addtolocal)948 c.PersistentFlags().VisitAll(addtolocal)949 }950 rmerge = func(x *Command) {951 if ! x.HasParent() {952 flag.CommandLine.VisitAll(func(f *flag.Flag) {953 if x.PersistentFlags().Lookup(f.Name) == nil {954 x.PersistentFlags().AddFlag(f)955 }956 })957 }958 if x.HasPersistentFlags() {959 x.PersistentFlags().VisitAll(func(f *flag.Flag) {960 if c.Flags().Lookup(f.Name) == nil {961 c.Flags().AddFlag(f)
10 unmodified lines