X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=shell-completion%2Fbash%2Fsystemctl.in;h=8063316ec66ee2dfc3d6edbb7b276889d5e8f66b;hb=cb01aedc3b4ba70859267159fe716253e3551ec6;hp=9e538a9a5bb323803e42da4f014fd1bcfbfe8bcb;hpb=9ff8af5460d57dfab78a1137ec743b539715e82a;p=elogind.git diff --git a/shell-completion/bash/systemctl.in b/shell-completion/bash/systemctl.in index 9e538a9a5..8063316ec 100644 --- a/shell-completion/bash/systemctl.in +++ b/shell-completion/bash/systemctl.in @@ -60,14 +60,20 @@ __get_active_units () { __systemctl $1 list-units \ | { while read -r a b; do echo " $a"; done; }; } __get_startable_units () { # find startable inactive units - __filter_units_by_property $mode LoadState loaded $( - __filter_units_by_property $mode ActiveState inactive $( - __filter_units_by_property $mode CanStart yes $( __get_all_units ))) + __filter_units_by_property $mode ActiveState inactive $( + __filter_units_by_property $mode CanStart yes $( + __systemctl $mode list-unit-files --state enabled,disabled,static | \ + { while read -r a b; do [[ $a =~ @\. ]] || echo " $a"; done; } + __systemctl $mode list-units --state inactive,failed | \ + { while read -r a b; do echo " $a"; done; } )) } __get_restartable_units () { # filter out masked and not-found - __filter_units_by_property $mode LoadState loaded $( - __filter_units_by_property $mode CanStart yes $( __get_all_units )) + __filter_units_by_property $mode CanStart yes $( + __systemctl $mode list-unit-files --state enabled,disabled,static | \ + { while read -r a b; do [[ $a =~ @\. ]] || echo " $a"; done; } + __systemctl $mode list-units | \ + { while read -r a b; do echo " $a"; done; } ) } __get_failed_units () { __systemctl $1 list-units \ | { while read -r a b c d; do [[ $c == "failed" ]] && echo " $a"; done; }; } @@ -133,7 +139,7 @@ _systemctl () { fi local -A VERBS=( - [ALL_UNITS]='is-active is-failed is-enabled status show cat mask preset help list-dependencies' + [ALL_UNITS]='is-active is-failed is-enabled status show cat mask preset help list-dependencies edit' [ENABLED_UNITS]='disable' [DISABLED_UNITS]='enable' [REENABLABLE_UNITS]='reenable'