[WIP] Completion for events --filter
Adds completion for the docker events --filter family.
@thaJeztah PTAL. This is in an early stage (only some filters implemented yet), and I would like to get early feedback whether I'm on the right track here.
For ContainerNames and NetworkNames I reuse existing completion functions in a hacky way.
I think we will hit more use cases like this, and a better solution would be appropriate.
Therefore I propose to pull out helper functions that just return the names (which I need here) from the existing helper functions.
Now I run into naming issues. Using the network example, the new function should be named NetworkNames, which forces me to rename the existing one to something like CompleteNetworkNames or NetworkNameCompletions.
To stay consistent, this would mean other completion helpers should be renamed as well, e.g. EnvVarNames -> CompleteEnvVarNames and VolumeNames -> CompleteVolumeNames.
WDYT?
Codecov Report
Attention: Patch coverage is 70.37037% with 32 lines in your changes missing coverage. Please review.
Project coverage is 59.64%. Comparing base (
21eea1e) to head (e1c5180). Report is 183 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #5538 +/- ##
==========================================
- Coverage 60.67% 59.64% -1.03%
==========================================
Files 345 346 +1
Lines 23491 29211 +5720
==========================================
+ Hits 14252 17422 +3170
- Misses 8266 10819 +2553
+ Partials 973 970 -3
@thaJeztah I just stepped over your completion tests. I'll take a look at it and try to add tests for the completions in this PR.
@thaJeztah I added tests for those commands that call the API. Please take a look before I clean up the commits and publish the PR.
The PR is ready for review now.
@thaJeztah Thanks for the review, I applied all of your suggestions. PTAL.
@thaJeztah Thanks for the review, I applied all of your suggestions. PTAL.
Thank you! Changes LGTM, but it's ok to squash my suggestions with the first commit (we don't need the history of the "review comments applied"). Could you squash the first and last commit?
Could you squash the first and last commit?
done.