Re: [systemd-devel] [PATCH] zsh-completion: fix completion of --user services

2015-06-17 Thread Eric Cook
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

[systemd-devel] [PATCH] zsh-completion: a more style/tag aware _systemctl

2015-05-29 Thread Eric Cook
using _wanted instead of calling compadd directly. this allows the user to customize possible matches. An example being, grouping units by type: autoload -Uz compinit; compinit zstyle ':completion:*' menu select zstyle ':completion:*' group-name '' zstyle ':completion:*' format 'Completing %d'

[systemd-devel] [PATCH] zsh-completion: fix completion of --user services

2015-05-18 Thread Eric Cook
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

[systemd-devel] [PATCH v2 5/6] zsh-completion: removing more pointless forks

2015-05-18 Thread Eric Cook
I seem to have forgot about _systemctl_active_units(). --- shell-completion/zsh/_systemctl.in | 30 ++ 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in index a4db563..d3e7ee2

[systemd-devel] [PATCH 5/6] zsh-completion: removing more pointless forks

2015-05-17 Thread Eric Cook
--- shell-completion/zsh/_systemctl.in | 28 +--- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in index a4db563..d2ebab0 100644 --- a/shell-completion/zsh/_systemctl.in +++

[systemd-devel] [PATCH 6/6] zsh-completion: make the arrays _sys_active_units, _sys_startable_units and _sys_restartable_units local to the completer.

2015-05-17 Thread Eric Cook
--- shell-completion/zsh/_systemctl.in | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in index d2ebab0..9b7f962 100644 --- a/shell-completion/zsh/_systemctl.in +++

[systemd-devel] [PATCH 2/6] zsh-completion: actually complete template names for subcommands enable, reenable and disable.

2015-05-17 Thread Eric Cook
compadd's -a option treats non-option arguments as arrays. So $(_systemctl_get_template_names) expands to some words that aren't legal array names. Even if there were, they would be empty; thus adding nothing. deduplicated a few functions too. --- shell-completion/zsh/_systemctl.in | 21

[systemd-devel] [PATCH 1/6] zsh-completion: actually run _filter_units_by_property when creating the arrays _sys_(re|)startable_units

2015-05-17 Thread Eric Cook
--- shell-completion/zsh/_systemctl.in | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in index cce9dea..8764e07 100644 --- a/shell-completion/zsh/_systemctl.in +++

[systemd-devel] [PATCH 3/6] zsh-completion: less forking in _systemctl_get_template_names()

2015-05-17 Thread Eric Cook
--- shell-completion/zsh/_systemctl.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in index f30fb84..5a39cfb 100644 --- a/shell-completion/zsh/_systemctl.in +++ b/shell-completion/zsh/_systemctl.in @@

[systemd-devel] [PATCH 4/6] zsh-completion: less forking in _systemctl_failed_units() and make the array `_sys_failed_units' local to the completer.

2015-05-17 Thread Eric Cook
--- shell-completion/zsh/_systemctl.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in index 5a39cfb..a4db563 100644 --- a/shell-completion/zsh/_systemctl.in +++ b/shell-completion/zsh/_systemctl.in

[systemd-devel] [PATCH] shell-completion(zsh): journalctl's -b changes

2014-09-27 Thread Eric Cook
removed pointless index sort of bootids. use `compadd -a' to add each array, instead of expanding possibly hundreds of words needlessly. optional completion of -b --- shell-completion/zsh/_journalctl | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[systemd-devel] [PATCH] shell-completion: prevent mangling unit names

2014-07-26 Thread Eric Cook
Units with literal hex '\xFF' in their names has to be read and printed properly. dev-disk-byx2dlabel-root.device != dev-disk-by\x2dlabel-root.device --- shell-completion/zsh/_systemctl.in | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git

[systemd-devel] [PATCH] shell-completion: prevent mangling unit names (bash)

2014-07-26 Thread Eric Cook
This looks seems like it should work. I would appreciate it if you could trail run it. My use of bash is limited and knowledge of it's completion system even more so. --- shell-completion/bash/systemctl.in | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git

Re: [systemd-devel] [PATCH] shell-completion: prevent mangling unit names (bash)

2014-07-26 Thread Eric Cook
On 07/26/2014 07:52 PM, Zbigniew Jędrzejewski-Szmek wrote: Unfortunately it works only partially. It seems that completions are generated properly, but bash doesn't seem to be able to continue after a backslash, so one has to copy in the remaining part by hand. Zbyszek Hm... (I think)Once we