From: Eric Cook Date: Mon, 18 May 2015 05:02:40 +0000 (-0400) Subject: zsh-completion: less forking in _systemctl_get_template_names() X-Git-Tag: v220~96 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e4e868f3aeedccfe04c6b6c3be026c7f8873370a;p=thirdparty%2Fsystemd.git zsh-completion: less forking in _systemctl_get_template_names() --- diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in index fc9fc2ea00a..304fec4782a 100644 --- a/shell-completion/zsh/_systemctl.in +++ b/shell-completion/zsh/_systemctl.in @@ -143,7 +143,7 @@ _filter_units_by_property() { done } -_systemctl_get_template_names() { __systemctl list-unit-files | { while read -r a b; do [[ $a =~ @\. ]] && echo -E - " ${a%%@.*}@"; done; } } +_systemctl_get_template_names() { echo -E - ${^${(M)${(f)"$(__systemctl list-unit-files)"}##*@.[^[:space:]]##}%%@.*}\@ } _systemctl_active_units() {_sys_active_units=( $(__systemctl list-units | { while read -r a b; do echo -E - " $a"; done; }) )}