MCPcopy Index your code
hub / github.com/docker/cli / hideFlagIf

Function hideFlagIf

cmd/docker/docker.go:570–583  ·  view source on GitHub ↗
(f *pflag.Flag, condition func(string) bool, annotation string)

Source from the content-addressed store, hash-verified

568}
569
570func hideFlagIf(f *pflag.Flag, condition func(string) bool, annotation string) {
571 if f.Hidden {
572 return
573 }
574 var val string
575 if values, ok := f.Annotations[annotation]; ok {
576 if len(values) > 0 {
577 val = values[0]
578 }
579 if condition(val) {
580 f.Hidden = true
581 }
582 }
583}
584
585func hideSubcommandIf(subcmd *cobra.Command, condition func(string) bool, annotation string) {
586 if subcmd.Hidden {

Callers 1

hideUnsupportedFeaturesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…