DockerCLI/cli/command/image
Sebastiaan van Stijn 809eb8cdee
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>
2024-02-03 18:10:55 +01:00
..
build change back nolint -> nosec 2024-01-03 15:33:16 +01:00
testdata images: print hint when invoking "docker images" with ambiguous argument 2024-02-03 18:10:55 +01:00
build.go Plumb contexts through commands 2023-12-12 22:30:16 +01:00
build_test.go Plumb contexts through commands 2023-12-12 22:30:16 +01:00
client_test.go Replace deprecated types.Image* usage 2024-01-24 14:59:10 +01:00
cmd.go Adopt Cobra completion v2 to support completion by CLI plugins 2022-05-12 12:59:10 +02:00
formatter_history.go linting: address else/if/elseif statements found by gocritic 2023-11-20 16:02:16 +01:00
formatter_history_test.go golangci-lint: enable dupword linter 2023-11-20 16:02:18 +01:00
history.go Plumb contexts through commands 2023-12-12 22:30:16 +01:00
history_test.go force TestNewHistoryCommandSuccess to use UTC timezone 2023-08-28 10:43:21 +02:00
import.go Replace deprecated types.Image* usage 2024-01-24 14:59:10 +01:00
import_test.go Replace deprecated types.Image* usage 2024-01-24 14:59:10 +01:00
inspect.go add //go:build directives to prevent downgrading to go1.16 language 2023-12-14 15:03:46 +01:00
inspect_test.go vendor: github.com/docker/docker v20.10.3-0.20220309172631-83b51522df43 2022-03-09 18:45:37 +01:00
list.go images: print hint when invoking "docker images" with ambiguous argument 2024-02-03 18:10:55 +01:00
list_test.go images: print hint when invoking "docker images" with ambiguous argument 2024-02-03 18:10:55 +01:00
load.go Plumb contexts through commands 2023-12-12 22:30:16 +01:00
load_test.go cli/command/image: remove deprecated io/ioutil and use t.TempDir() 2022-02-25 15:41:55 +01:00
prune.go Plumb contexts through commands 2023-12-12 22:30:16 +01:00
prune_test.go vendor: github.com/docker/docker cdb3f9fb8dca (v25.0.0-dev) 2023-10-13 22:09:04 +02:00
pull.go Plumb contexts through commands 2023-12-12 22:30:16 +01:00
pull_test.go Replace deprecated types.Image* usage 2024-01-24 14:59:10 +01:00
push.go Replace deprecated types.Image* usage 2024-01-24 14:59:10 +01:00
push_test.go Replace deprecated types.Image* usage 2024-01-24 14:59:10 +01:00
remove.go Replace deprecated types.Image* usage 2024-01-24 14:59:10 +01:00
remove_test.go Replace deprecated types.Image* usage 2024-01-24 14:59:10 +01:00
save.go Plumb contexts through commands 2023-12-12 22:30:16 +01:00
save_test.go cli/command/image: remove deprecated io/ioutil and use t.TempDir() 2022-02-25 15:41:55 +01:00
tag.go Plumb contexts through commands 2023-12-12 22:30:16 +01:00
tag_test.go cli/command/image: remove deprecated io/ioutil and use t.TempDir() 2022-02-25 15:41:55 +01:00
trust.go Replace deprecated types.Image* usage 2024-01-24 14:59:10 +01:00
trust_test.go replace uses of deprecated env.Patch() 2022-09-22 17:28:07 +02:00