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

Function printAmbiguousHint

cli/command/image/list.go:197–216  ·  view source on GitHub ↗

printAmbiguousHint prints an informational warning if the provided filter argument is ambiguous. The "docker images" top-level subcommand predates the "docker " convention (e.g. "docker image ls"), but accepts a positional argument to search/filter images by name (globbing). It's com

(stdErr io.Writer, matchName string)

Source from the content-addressed store, hash-verified

195// Disallowing these search-terms would be a breaking change, but we can print
196// and informational message to help the users correct their mistake.
197func printAmbiguousHint(stdErr io.Writer, matchName string) {
198 switch matchName {
199 // List of subcommands for "docker image" and their aliases (see "docker image --help"):
200 case "build",
201 "history",
202 "import",
203 "inspect",
204 "list",
205 "load",
206 "ls",
207 "prune",
208 "pull",
209 "push",
210 "rm",
211 "save",
212 "tag":
213
214 _, _ = fmt.Fprintf(stdErr, "No images found matching %q: did you mean \"docker image %[1]s\"?\n", matchName)
215 }
216}

Callers 1

newImagesCommandFunction · 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…