Merge pull request #3480 from jbeda/all_pflag

Convert all main binaries to pflag library
This commit is contained in:
Joe Beda
2015-01-15 11:26:41 -08:00
46 changed files with 335 additions and 272 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)