Re: [systemd-devel] [PATCH] zsh-completion: fix completion of --user services
On 06/17/2015 12:34 PM, Lennart Poettering wrote: On Mon, 18.05.15 18:45, Eric Cook (l...@gmx.com) wrote: By the time __systemctl is called, --user/--system are shifted out of `words' by _arguments. This patch queries the array sooner. In the case that both --user and --system are on the line when compsys runs, _sys_service_mgr is set to the latter. Which is seemingly how systemctl behaves. If neither are on the line, --system is set; for system services to be completed. Is this still an issue? If so, could you post this patch as a PR on github for review? Lennart It was submitted on github and merged a while ago. So no, but thank you for checking up on it. https://github.com/systemd/systemd/commit/68c4f6d406a2bdac6957a67a077f182b0287cc3b ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] zsh-completion: fix completion of --user services
By the time __systemctl is called, --user/--system are shifted out of `words' by _arguments. This patch queries the array sooner. In the case that both --user and --system are on the line when compsys runs, _sys_service_mgr is set to the latter. Which is seemingly how systemctl behaves. If neither are on the line, --system is set; for system services to be completed. --- shell-completion/zsh/_systemctl.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in index 1dc6406..bd5eece 100644 --- a/shell-completion/zsh/_systemctl.in +++ b/shell-completion/zsh/_systemctl.in @@ -93,9 +93,7 @@ __systemctl() { - local -a _modes - _modes=(--user --system) - systemctl ${words:*_modes} --full --no-legend --no-pager $@ + systemctl $_sys_service_mgr --full --no-legend --no-pager $@ } @@ -355,6 +353,8 @@ _job_modes() { _values -s , ${_modes[@]} } +local -a _modes; _modes=(--user --system) +local _sys_service_mgr=${${words:*_modes}[(R)(${(j.|.)_modes})]:---system} _arguments -s \ {-h,--help}'[Show help]' \ '--version[Show package version]' \ -- 2.1.4 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] zsh-completion: fix completion of --user services
Patchset imported to github. Pull request: https://github.com/systemd-devs/systemd/compare/master...systemd-mailing-devs:1431989131-25145-1-git-send-email-llua%40gmx.com -- Generated by https://github.com/haraldh/mail2git ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel