chiark / gitweb /
systemctl: allow multiple arguments to --type
[elogind.git] / shell-completion / bash / systemctl
index aba76f65433ea5b17d92a863360a745c85eec732..f24a1454245b8afb2032f1e0fa582ed5796417f8 100644 (file)
@@ -45,7 +45,7 @@ __get_all_units      () { __systemctl $1 list-units --all \
         | { while read -r a b; do echo " $a"; done; }; }
 __get_active_units   () { __systemctl $1 list-units       \
         | { while read -r a b; do echo " $a"; done; }; }
-__get_inactive_units () { __systemctl $1 list-units --all \
+__get_startable_units () { __systemctl $1 list-units --all -t service,timer,socket,mount,automount,path,snapshot,swap \
         | { while read -r a b c d; do [[ $c == "inactive" || $c == "failed " ]] && echo " $a"; done; }; }
 __get_failed_units   () { __systemctl $1 list-units       \
         | { while read -r a b c d; do [[ $c == "failed"   ]] && echo " $a"; done; }; }
@@ -156,10 +156,7 @@ _systemctl () {
 
         elif __contains_word "$verb" ${VERBS[STARTABLE_UNITS]}; then
                 comps=$( __filter_units_by_property $mode CanStart yes \
-                      $( __get_inactive_units $mode \
-                        | while read -r line; do \
-                                [[ "$line" =~ \.(device|snapshot)$ ]] || echo " $line"; \
-                        done ))
+                      $( __get_startable_units $mode))
 
         elif __contains_word "$verb" ${VERBS[RESTARTABLE_UNITS]}; then
                 comps=$( __filter_units_by_property $mode CanStart yes \