images: print hint when invoking "docker images" with ambiguous argument
The `docker images` top-level subcommand predates the `docker <object> <verb>`
convention (e.g. `docker image ls`), but accepts a positional argument to
search/filter images by name (globbing). It's common for users to accidentally
mistake these commands, and to use (e.g.) `docker images ls`, expecting
to see all images, but ending up with an empty list because no image named
"ls" was found.
Disallowing these search-terms would be a breaking change, but we can print
and informational message to help the users correct their mistake.
Before this patch:
docker images ls
REPOSITORY TAG IMAGE ID CREATED SIZE
With this patch applied:
docker images ls
REPOSITORY TAG IMAGE ID CREATED SIZE
No images found matching "ls": did you mean "docker image ls"?
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
2
cli/command/image/testdata/list-command-ambiguous.golden
vendored
Normal file
2
cli/command/image/testdata/list-command-ambiguous.golden
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
No images found matching "ls": did you mean "docker image ls"?
|
||||
Reference in New Issue
Block a user