Persistent flags should also be used in completions

This commit is contained in:
Fabiano Franz 2015-11-04 14:40:11 -05:00
parent 2e6a428921
commit 8fc369c700

View file

@ -305,6 +305,12 @@ func writeFlags(cmd *Command, out *bytes.Buffer) {
writeShortFlag(flag, out)
}
})
cmd.InheritedFlags().VisitAll(func(flag *pflag.Flag) {
writeFlag(flag, out)
if len(flag.Shorthand) > 0 {
writeShortFlag(flag, out)
}
})
fmt.Fprintf(out, "\n")
}