Use pflag functions instead of ours.

This commit is contained in:
Eric Paris
2015-08-16 23:33:44 -07:00
parent 681ee126ff
commit bcf912667b
7 changed files with 20 additions and 126 deletions

View File

@@ -77,8 +77,8 @@ func (hk *HyperKube) Flags() *pflag.FlagSet {
// These will add all of the "global" flags (defined with both the
// flag and pflag packages) to the new flag set we have.
util.AddFlagSetToPFlagSet(flag.CommandLine, hk.baseFlags)
util.AddPFlagSetToPFlagSet(pflag.CommandLine, hk.baseFlags)
hk.baseFlags.AddGoFlagSet(flag.CommandLine)
hk.baseFlags.AddFlagSet(pflag.CommandLine)
}
return hk.baseFlags
@@ -154,7 +154,7 @@ func (hk *HyperKube) Run(args []string) error {
return err
}
util.AddPFlagSetToPFlagSet(hk.Flags(), s.Flags())
s.Flags().AddFlagSet(hk.Flags())
err = s.Flags().Parse(args)
if err != nil || hk.helpFlagVal {
if err != nil {