-
Notifications
You must be signed in to change notification settings - Fork 18.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zsh completion updates #15915
Zsh completion updates #15915
Conversation
Currently, all good for me! |
Thanks @sdurrheimer. Let me know when this is ready to merge. |
7f87052
to
e29f59a
Compare
@calavera I'm encountering a issue with the docker daemon command. Since it is not listed in the |
oh, that's weird. I had the feeling that the command was in the help too. Maybe @tiborvass can clarify that, I don't know if it's a bug. |
@sdurrheimer it indeed changed, but it is listed on platforms that support it. On platforms that only have clients (e.g. darwin), it is not listed. On Linux:
On OS X:
|
@tiborvass This is not the issue I described, sorry for my poor explanation. What I was saying is that the
The current zsh completion system for commands is automatic, based on this list. |
@sdurrheimer right, I'm afraid the completion script will have to add |
Ok I will add it manually like the help command. |
The recent merge of PR #15421 is causing issues with autocompletion of running/stopped containers. By truncating image names, the zsh completion is grouping containers badly. Example:
In this example, Since the script is using
Example:
Here we can see invalid names like All those problems would be solved by not truncating image names, relevant PR #15472. |
@sdurrheimer I did not test with Docker 1.8 but I did introduce a bug in one of my previous commit. I have fixed it here: felixr/docker-zsh-completion@cd0f1b9 Also, have a look at this commit to avoid using "-1" when we know that a field is the last: felixr/docker-zsh-completion@4ccd292 And I have also done this: felixr/docker-zsh-completion@8bf9041 It works with 1.7. I think that the bogus names that you see are due to my first bug. |
@vincentbernat Oh ok, I've added them to this PR if it's ok for you. I will also test them if those commits solves the problem with 1.9.0-dev. |
b9d449a
to
cd2d68b
Compare
how about we do two parts and try to get in what you have now then you can make another PR with the other changes so they are smaller to review and this isnt waiting around :) |
Same question as @jfrazelle (#15915 (comment)); I think you're doing great work, but often smaller, incremental PRs make it easier to review, and get merged. (Just a bit concerned we try to do too much in a single PR, and at the pace Docker is moving, it's hard to get everything right) 👍 |
@jfrazelle @thaJeztah I totally agree. The projet is moving fast and I was not able to follow the progression lately. I still need to do the container naming modification discussed with @vincentbernat. I was hoping the #16031 to be merged before mine since it will create a conflict in mine (or vice versa). @vincentbernat Do you want to copy those changes into felixr/docker-zsh-completion repository, so that we can reference them in the squashed commit message ? |
d9414a7
to
59c4d21
Compare
I have pushed all your commits to felixr/docker-zsh-completion. They are: felixr/docker-zsh-completion@7f996bf82d5c: Add docker daemon command to zsh completion felixr/docker-zsh-completion@b721bbbb9e27: Only keep the last name for a running/stopped container And if you could review this one, we would be in sync: felixr/docker-zsh-completion@6791b3edf378: Fix "docker run --stop-signal" completion |
@vincentbernat
With |
I don't find the examples you posted earlier (GitHub should show outdated comments somewhere, but I don't see them). Is the "good" name always the first one? Then, yes, in this case, turn |
@vincentbernat Yeah true. This is kind of odd. |
Taking the one without |
Here is my take: felixr/docker-zsh-completion@961f628d4376. Tell me if it works as expected for you. |
@vincentbernat It works, but I have tested with only one of my examples yet. It's kind of hacky and harder to maintain. Maybe should we try to convince the docker staff to not truncate the image name in regular P.S: I've just rebased to resolve recent conflict with |
Yes, if they can revert this change, it would be great. Meanwhile, this hack should work as expected. I hope that #15472 will make it before a new release so that we won't have to keep the hack at all. Otherwise, we may have to keep it a bit (as the completion is in contrib, I believe some people may fetch it directly because it lags a bit behind, but I may be wrong). |
- felixr/docker-zsh-completion@6ae6279: Add --privileged flag to docker exec command in zsh completion - felixr/docker-zsh-completion@259ea00: Remove -h help flag from subcommands in zsh completion - felixr/docker-zsh-completion@5f77b29: Add docker ps --format flag to zsh completion - felixr/docker-zsh-completion@a1f39f8: Add --config flag to zsh completion - felixr/docker-zsh-completion@6a503b4: Filter zsh completions of inspect command by --type - felixr/docker-zsh-completion@d286ccd: Add --ulimit flag to build command to zsh completion - felixr/docker-zsh-completion@bdc1261: Add support for kernel memory limit in zsh completion - felixr/docker-zsh-completion@c8ce164: Add docker volume command and subcommands in zsh completion - felixr/docker-zsh-completion@7f996bf: Add docker daemon command to zsh completion - felixr/docker-zsh-completion@4ccd292: Be more generic when parsing "docker ps" output. - felixr/docker-zsh-completion@cd0f1b9: Fix container completion by name - felixr/docker-zsh-completion@8bf9041: Use "docker ps --no-trunc" to build completion. - felixr/docker-zsh-completion@b721bbb: Only keep the last name for a running/stopped container - felixr/docker-zsh-completion@6791b3e: Fix "docker run --stop-signal" completion - felixr/docker-zsh-completion@961f628: Try some heuristics to determine the canonical container name Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
Ok, I've squashed those commits into one. So @calavera it's ready to be merged. We will see later if the |
OMG so many changes, thanks @sdurrheimer. We should really try to be better at keeping zsh completion in sync. Specially because I use zsh 😬 LGTM |
LGTM |
Hello,
Trying to catch up missing changes for the zsh completion.
TODO
--dns-opt
todaemon
command when Add support for DNS options #16031 is mergedlog driver options ? log driver - Interpolate fields into log tag #15384@vincentbernat