MCPcopy
hub / github.com/helm/helm / addKlogFlags

Function addKlogFlags

pkg/cmd/flags.go:290–302  ·  view source on GitHub ↗

addKlogFlags adds flags from k8s.io/klog marks the flags as hidden to avoid polluting the help text

(fs *pflag.FlagSet)

Source from the content-addressed store, hash-verified

288// addKlogFlags adds flags from k8s.io/klog
289// marks the flags as hidden to avoid polluting the help text
290func 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
305func normalize(s string) string {

Callers 1

newRootCmdWithConfigFunction · 0.85

Calls 1

normalizeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…