mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-06 19:52:42 +00:00
Use pflags word separators to make - and _ equiv.
This commit is contained in:
@@ -70,6 +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.BoolVarP(&hk.helpFlagVal, "help", "h", false, "help for "+hk.Name)
|
||||
|
||||
// These will add all of the "global" flags (defined with both the
|
||||
|
@@ -68,6 +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{"-", "_"})
|
||||
}
|
||||
return s.flags
|
||||
}
|
||||
|
Reference in New Issue
Block a user