c28716f
From 21427b3c9865a0a7871d47e55b041d371dcfe36f Mon Sep 17 00:00:00 2001
c28716f
From: Eric Cook <llua@gmx.com>
c28716f
Date: Mon, 18 May 2015 01:02:38 -0400
c28716f
Subject: [PATCH] zsh-completion: actually run _filter_units_by_property when
c28716f
 creating the arrays _sys_(re|)startable_units
c28716f
c28716f
(cherry picked from commit 67afa93148ca51eb1d37717ad3c3cac980be1c7a)
c28716f
---
c28716f
 shell-completion/zsh/_systemctl.in | 9 +++++----
c28716f
 1 file changed, 5 insertions(+), 4 deletions(-)
c28716f
c28716f
diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in
c28716f
index 82edfd3d74..d2024b3cce 100644
c28716f
--- a/shell-completion/zsh/_systemctl.in
c28716f
+++ b/shell-completion/zsh/_systemctl.in
c28716f
@@ -149,20 +149,20 @@ _systemctl_get_template_names() { __systemctl list-unit-files | { while read -r
c28716f
 _systemctl_active_units()  {_sys_active_units=(  $(__systemctl list-units          | { while read -r a b; do echo -E - " $a"; done; }) )}
c28716f
 
c28716f
 _systemctl_startable_units(){
c28716f
-    _sys_startable_units=(_filter_units_by_property ActiveState inactive $(
c28716f
+    _sys_startable_units=( $( _filter_units_by_property ActiveState inactive $(
c28716f
                           _filter_units_by_property CanStart yes $(
c28716f
                           __systemctl $mode list-unit-files --state enabled,disabled,static | \
c28716f
                                { while read -r a b; do [[ $a =~ @\. ]] || echo -E - " $a"; done; }
c28716f
                           __systemctl $mode list-units --state inactive,failed | \
c28716f
-                               { while read -r a b; do echo -E - " $a"; done; } )))
c28716f
+                               { while read -r a b; do echo -E - " $a"; done; } )) ) )
c28716f
 }
c28716f
 
c28716f
 _systemctl_restartable_units(){
c28716f
-    _sys_restartable_units=(_filter_units_by_property CanStart yes $(
c28716f
+    _sys_restartable_units=( $(_filter_units_by_property CanStart yes $(
c28716f
                           __systemctl $mode list-unit-files --state enabled,disabled,static | \
c28716f
                                { while read -r a b; do [[ $a =~ @\. ]] || echo -E - " $a"; done; }
c28716f
                           __systemctl $mode list-units | \
c28716f
-                               { while read -r a b; do echo -E - " $a"; done; } ))
c28716f
+                               { while read -r a b; do echo -E - " $a"; done; } )) )
c28716f
 }
c28716f
 
c28716f
 _systemctl_failed_units()  {_sys_failed_units=(  $(__systemctl list-units --failed | { while read -r a b; do echo -E - " $a"; done; }) )}
c28716f
@@ -170,6 +170,7 @@ _systemctl_enabled_units() {_sys_enabled_units=( $(__systemctl list-unit-files
c28716f
 _systemctl_disabled_units(){_sys_disabled_units=($(__systemctl list-unit-files     | { while read -r a b; do [[ $b == "disabled" ]] && echo -E - " $a"; done; }) )}
c28716f
 _systemctl_masked_units()  {_sys_masked_units=(  $(__systemctl list-unit-files     | { while read -r a b; do [[ $b == "masked" ]] && echo -E - " $a"; done; }) )}
c28716f
 
c28716f
+local fun
c28716f
 # Completion functions for ALL_UNITS
c28716f
 for fun in is-active is-failed is-enabled status show cat mask preset help list-dependencies edit ; do
c28716f
   (( $+functions[_systemctl_$fun] )) || _systemctl_$fun()