[systemd-devel] [PATCH] bash-completion: fix systemctl isolate

Jan Synacek jsynacek at redhat.com
Thu Oct 9 03:03:38 PDT 2014


---
 shell-completion/bash/systemctl.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/shell-completion/bash/systemctl.in b/shell-completion/bash/systemctl.in
index 0150018..e47c028 100644
--- a/shell-completion/bash/systemctl.in
+++ b/shell-completion/bash/systemctl.in
@@ -67,6 +67,8 @@ __get_disabled_units () { __systemctl $1 list-unit-files  \
         | { while read -r a b c  ; do [[ $b == "disabled" ]] && echo " $a"; done; }; }
 __get_masked_units   () { __systemctl $1 list-unit-files  \
         | { while read -r a b c  ; do [[ $b == "masked"   ]] && echo " $a"; done; }; }
+__get_all_targets    () { { __systemctl $1 list-units -t target --all; } \
+        | { while read -r a b; do echo " $a"; done; }; }
 
 _systemctl () {
         local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
@@ -198,7 +200,7 @@ _systemctl () {
 
         elif __contains_word "$verb" ${VERBS[ISOLATABLE_UNITS]}; then
                 comps=$( __filter_units_by_property $mode AllowIsolate yes \
-                      $( __get_all_units $mode ) )
+                      $( __get_all_targets $mode ) )
                 compopt -o filenames
 
         elif __contains_word "$verb" ${VERBS[FAILED_UNITS]}; then
-- 
1.9.3



More information about the systemd-devel mailing list