Fix up logging flags for kubectl.

This commit is contained in:
Joe Beda
2015-01-14 14:54:39 -08:00
parent 7ee327146a
commit 1d0b6ee5f5
3 changed files with 16 additions and 2 deletions

View File

@@ -143,6 +143,10 @@ func (f *Factory) BindFlags(flags *pflag.FlagSet) {
// any flags defined by external projects (not part of pflags)
util.AddAllFlagsToPFlagSet(flags)
// This is necessary as github.com/spf13/cobra doesn't support "global"
// pflags currently. See https://github.com/spf13/cobra/issues/44.
util.AddPFlagSetToPFlagSet(pflag.CommandLine, flags)
if f.flags != nil {
f.flags.VisitAll(func(flag *pflag.Flag) {
flags.AddFlag(flag)