docker / cli

The Docker CLI
Apache License 2.0
4.75k stars 1.88k forks source link

Enable completion for some 'image' sub commands #5223

Closed fredden closed 6 days ago

fredden commented 1 week ago

- What I did This pull request enables shell completion for these commands:

- How I did it I have added a ValidArgsFunction to each of the relevant commands.

- How to verify it I ran make dev to enter a development shell, and then make && ./build/docker __completeNoDesc image rm "" (and similar for the other commands being modified) to verify expected output (both before & after making code changes).

I also ran make test which reported success.

- Description for the changelog

Enable shell completion for `docker image rm`, `docker image history`, and `docker image inspect`.

This change fixes https://github.com/docker/cli/issues/4588.

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

codecov-commenter commented 6 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 61.46%. Comparing base (bab48eb) to head (c7d46aa). Report is 6 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #5223 +/- ## ========================================== - Coverage 61.47% 61.46% -0.01% ========================================== Files 298 298 Lines 20808 20807 -1 ========================================== - Hits 12791 12790 -1 Misses 7105 7105 Partials 912 912 ```