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

Eric Cook llua at gmx.com
Sun May 17 22:02:40 PDT 2015


---
 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
@@ -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; }) )}
-- 
2.1.4



More information about the systemd-devel mailing list