ryantimwilson / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone
Zbigniew Jędrzejewski-Szmek a48f80
From 5ee6d932fe185b8ae007bb47b34026308ac33623 Mon Sep 17 00:00:00 2001
Zbigniew Jędrzejewski-Szmek a48f80
From: Eric Cook <llua@gmx.com>
Zbigniew Jędrzejewski-Szmek a48f80
Date: Mon, 18 May 2015 01:02:40 -0400
Zbigniew Jędrzejewski-Szmek a48f80
Subject: [PATCH] zsh-completion: less forking in
Zbigniew Jędrzejewski-Szmek a48f80
 _systemctl_get_template_names()
Zbigniew Jędrzejewski-Szmek a48f80
Zbigniew Jędrzejewski-Szmek a48f80
(cherry picked from commit e4e868f3aeedccfe04c6b6c3be026c7f8873370a)
Zbigniew Jędrzejewski-Szmek a48f80
---
Zbigniew Jędrzejewski-Szmek a48f80
 shell-completion/zsh/_systemctl.in | 2 +-
Zbigniew Jędrzejewski-Szmek a48f80
 1 file changed, 1 insertion(+), 1 deletion(-)
Zbigniew Jędrzejewski-Szmek a48f80
Zbigniew Jędrzejewski-Szmek a48f80
diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in
Zbigniew Jędrzejewski-Szmek a48f80
index 427572355a..b8921791dd 100644
Zbigniew Jędrzejewski-Szmek a48f80
--- a/shell-completion/zsh/_systemctl.in
Zbigniew Jędrzejewski-Szmek a48f80
+++ b/shell-completion/zsh/_systemctl.in
Zbigniew Jędrzejewski-Szmek a48f80
@@ -143,7 +143,7 @@ _filter_units_by_property() {
Zbigniew Jędrzejewski-Szmek a48f80
   done
Zbigniew Jędrzejewski-Szmek a48f80
 }
Zbigniew Jędrzejewski-Szmek a48f80
 
Zbigniew Jędrzejewski-Szmek a48f80
-_systemctl_get_template_names() { __systemctl list-unit-files | { while read -r a b; do  [[ $a =~ @\. ]] && echo -E - " ${a%%@.*}@"; done; } }
Zbigniew Jędrzejewski-Szmek a48f80
+_systemctl_get_template_names() { echo -E - ${^${(M)${(f)"$(__systemctl list-unit-files)"}##*@.[^[:space:]]##}%%@.*}\@ }
Zbigniew Jędrzejewski-Szmek a48f80
 
Zbigniew Jędrzejewski-Szmek a48f80
 
Zbigniew Jędrzejewski-Szmek a48f80
 _systemctl_active_units()  {_sys_active_units=(  $(__systemctl list-units          | { while read -r a b; do echo -E - " $a"; done; }) )}