zsh-completion: less forking in _systemctl_get_template_names()

This commit is contained in:
Eric Cook 2015-05-18 01:02:40 -04:00 committed by Zbigniew Jędrzejewski-Szmek
parent fb869ca1d2
commit e4e868f3ae

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