X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=shell-completion%2Fbash%2Fsystemctl;h=aba76f65433ea5b17d92a863360a745c85eec732;hp=b019d6aecf5683c18cd3a6722b1a9783e0083f23;hb=c2e09812e9c088f1582ce542e43f6b5743b2e4fe;hpb=79c1638303142b81e1b72dd5bde0c656ccf19999 diff --git a/shell-completion/bash/systemctl b/shell-completion/bash/systemctl index b019d6aec..aba76f654 100644 --- a/shell-completion/bash/systemctl +++ b/shell-completion/bash/systemctl @@ -46,7 +46,7 @@ __get_all_units () { __systemctl $1 list-units --all \ __get_active_units () { __systemctl $1 list-units \ | { while read -r a b; do echo " $a"; done; }; } __get_inactive_units () { __systemctl $1 list-units --all \ - | { while read -r a b c d; do [[ $c == "inactive" ]] && echo " $a"; done; }; } + | { 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; }; } __get_enabled_units () { __systemctl $1 list-unit-files \ @@ -109,8 +109,9 @@ _systemctl () { local -A VERBS=( [ALL_UNITS]='is-active is-failed is-enabled status show mask preset' - [ENABLED_UNITS]='disable reenable' + [ENABLED_UNITS]='disable' [DISABLED_UNITS]='enable' + [REENABLABLE_UNITS]='reenable' [FAILED_UNITS]='reset-failed' [STARTABLE_UNITS]='start' [STOPPABLE_UNITS]='stop condstop kill try-restart condrestart' @@ -149,6 +150,10 @@ _systemctl () { elif __contains_word "$verb" ${VERBS[DISABLED_UNITS]}; then comps=$( __get_disabled_units $mode ) + elif __contains_word "$verb" ${VERBS[REENABLABLE_UNITS]}; then + comps=$( __get_disabled_units $mode; + __get_enabled_units $mode ) + elif __contains_word "$verb" ${VERBS[STARTABLE_UNITS]}; then comps=$( __filter_units_by_property $mode CanStart yes \ $( __get_inactive_units $mode \