zsh-completion: less forking in _systemctl_get_template_names()

(cherry picked from commit e4e868f3ae)
This commit is contained in:
Eric Cook
2015-05-20 01:24:46 -04:00
committed by Zbigniew Jędrzejewski-Szmek
parent 5fcc4e9b79
commit 5ee6d932fe
+1 -1
View File
@@ -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; }) )}