addKlogFlags adds flags from k8s.io/klog marks the flags as hidden to avoid polluting the help text
(fs *pflag.FlagSet)
| 288 | // addKlogFlags adds flags from k8s.io/klog |
| 289 | // marks the flags as hidden to avoid polluting the help text |
| 290 | func addKlogFlags(fs *pflag.FlagSet) { |
| 291 | local := flag.NewFlagSet("klog", flag.ExitOnError) |
| 292 | klog.InitFlags(local) |
| 293 | local.VisitAll(func(fl *flag.Flag) { |
| 294 | fl.Name = normalize(fl.Name) |
| 295 | if fs.Lookup(fl.Name) != nil { |
| 296 | return |
| 297 | } |
| 298 | newflag := pflag.PFlagFromGoFlag(fl) |
| 299 | newflag.Hidden = true |
| 300 | fs.AddFlag(newflag) |
| 301 | }) |
| 302 | } |
| 303 | |
| 304 | // normalize replaces underscores with hyphens |
| 305 | func normalize(s string) string { |
no test coverage detected
searching dependent graphs…