Merge pull request #7510 from eparis/cobra-rebase

Cobra rebase
This commit is contained in:
Jeff Lowdermilk
2015-04-29 15:08:41 -07:00
41 changed files with 309 additions and 121 deletions

View File

@@ -70,7 +70,7 @@ func (hk *HyperKube) Flags() *pflag.FlagSet {
if hk.baseFlags == nil {
hk.baseFlags = pflag.NewFlagSet(hk.Name, pflag.ContinueOnError)
hk.baseFlags.SetOutput(ioutil.Discard)
hk.baseFlags.SetWordSeparators([]string{"-", "_"})
hk.baseFlags.SetNormalizeFunc(util.WordSepNormalizeFunc)
hk.baseFlags.BoolVarP(&hk.helpFlagVal, "help", "h", false, "help for "+hk.Name)
// These will add all of the "global" flags (defined with both the

View File

@@ -68,7 +68,7 @@ func (s *Server) Flags() *pflag.FlagSet {
if s.flags == nil {
s.flags = pflag.NewFlagSet(s.Name(), pflag.ContinueOnError)
s.flags.SetOutput(ioutil.Discard)
s.flags.SetWordSeparators([]string{"-", "_"})
s.flags.SetNormalizeFunc(util.WordSepNormalizeFunc)
}
return s.flags
}

View File

@@ -31,6 +31,7 @@ import (
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta1"
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta2"
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta3"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/ghodss/yaml"
flag "github.com/spf13/pflag"
@@ -55,7 +56,7 @@ func isYAML(data []byte) bool {
func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
flag.CommandLine.SetWordSeparators([]string{"-", "_"})
flag.CommandLine.SetNormalizeFunc(util.WordSepNormalizeFunc)
flag.Parse()
if *rewrite != "" {