Skip to content

Conversation

@thaJeztah
Copy link
Member

The "docker inspect" command can inspect any type of object, which would require all possible endpoints to be contacted. By default, we don't provide completion, but if a --type is passed, we provide completion for the given type.

For example, docker inspect --type container will complete container names, docker inspect --type volume will complete volume names and so on.

- Human readable description for the release notes

Add shell completion for `docker inspect` if a `--type` is set.

- A picture of a cute animal (not mandatory but encouraged)

The "docker inspect" command can inspect any type of object, which would
require all possible endpoints to be contacted. By default, we don't
provide completion, but if a `--type` is passed, we provide completion
for the given type.

For example, `docker inspect --type container` will complete container
names, `docker inspect --type volume` will complete volume names and
so on.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Comment on lines +322 to +323
// TODO(thaJeztah): completion functions in this package don't remove names that have already been completed
// this causes completion to continue even if a given name was already completed.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is something to fix; I think I fixed this in some other places, but currently the completion functions don't take existing completions into account, so (e.g.) if there's a single container named foo, then pressing tab will continue to provide foo as completion.

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 1.19048% with 83 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cli/command/system/completion.go 1.19% 82 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@thaJeztah thaJeztah merged commit 8b23c2b into docker:master Sep 10, 2025
117 of 118 checks passed
@thaJeztah thaJeztah deleted the inspect_completion branch September 10, 2025 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants