mirror of
https://github.com/spf13/cobra
synced 2024-11-24 22:57:12 +00:00
updating 'private' to 'hidden' to match a corresponding change in pflag
This commit is contained in:
parent
0a7cad51ef
commit
1c544baa19
1 changed files with 3 additions and 3 deletions
|
@ -917,14 +917,14 @@ func (c *Command) LocalFlags() *flag.FlagSet {
|
|||
|
||||
local := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
|
||||
c.lflags.VisitAll(func(f *flag.Flag) {
|
||||
if !f.Private {
|
||||
if !f.Hidden {
|
||||
local.AddFlag(f)
|
||||
}
|
||||
})
|
||||
if !c.HasParent() {
|
||||
flag.CommandLine.VisitAll(func(f *flag.Flag) {
|
||||
if local.Lookup(f.Name) == nil {
|
||||
if !f.Private {
|
||||
if !f.Hidden {
|
||||
local.AddFlag(f)
|
||||
}
|
||||
}
|
||||
|
@ -946,7 +946,7 @@ func (c *Command) InheritedFlags() *flag.FlagSet {
|
|||
if x.HasPersistentFlags() {
|
||||
x.PersistentFlags().VisitAll(func(f *flag.Flag) {
|
||||
if inherited.Lookup(f.Name) == nil && local.Lookup(f.Name) == nil {
|
||||
if !f.Private {
|
||||
if !f.Hidden {
|
||||
inherited.AddFlag(f)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue