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

Function visitAll

cmd/docker/docker.go:282–289  ·  view source on GitHub ↗

visitAll traverses all commands from the root.

(root *cobra.Command, fns ...func(*cobra.Command))

Source from the content-addressed store, hash-verified

280
281// visitAll traverses all commands from the root.
282func visitAll(root *cobra.Command, fns ...func(*cobra.Command)) {
283 for _, cmd := range root.Commands() {
284 visitAll(cmd, fns...)
285 }
286 for _, fn := range fns {
287 fn(root)
288 }
289}
290
291// The Args is handled by ValidateArgs in cobra, which does not allows a pre-hook.
292// As a result, here we replace the existing Args validation func to a wrapper,

Callers 3

newDockerCommandFunction · 0.70
TestVisitAllFunction · 0.70

Calls

no outgoing calls

Tested by 2

TestVisitAllFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…