X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fsystemctl-bash-completion.sh;h=6369a6ca3925b4425cebb771f4dba3ee02e3cbcb;hp=f3420217b538640a55a75144686ff03988f9d337;hb=8112e84f657839a056afb411249a627956518b24;hpb=e67c3609b18ab09499b361e18addfcfdec853fdd diff --git a/src/systemctl-bash-completion.sh b/src/systemctl-bash-completion.sh index f3420217b..6369a6ca3 100644 --- a/src/systemctl-bash-completion.sh +++ b/src/systemctl-bash-completion.sh @@ -43,9 +43,9 @@ _systemctl () { local -A OPTS=( [STANDALONE]='--all -a --defaults --fail --ignore-dependencies --failed --force -f --full --global - --help -h --no-ask-password --no-block --no-reload --no-wall - --order --require --quiet -q --system --user --version' - [ARG]='--kill-mode --kill-who --property -p --signal -s --type -t' + --help -h --no-ask-password --no-block --no-pager --no-reload --no-wall + --order --require --quiet -q --privileged -P --system --user --version' + [ARG]='--host -H --kill-mode --kill-who --property -p --signal -s --type -t' ) if __contains_word "$prev" ${OPTS[ARG]}; then @@ -60,9 +60,9 @@ _systemctl () { comps='all control main' ;; --kill-mode) - comps='control-group process process-group' + comps='control-group process' ;; - --property|-p) + --property|-p|--host|-H) comps='' ;; esac @@ -79,10 +79,11 @@ _systemctl () { local -A VERBS=( [ALL_UNITS]='enable disable is-active is-enabled status show' [FAILED_UNITS]='reset-failed' - [STARTABLE_UNITS]='start restart reload-or-restart' + [STARTABLE_UNITS]='start' [STOPPABLE_UNITS]='stop kill try-restart condrestart' - [ISOLATEBLE_UNITS]='isolate' + [ISOLATABLE_UNITS]='isolate' [RELOADABLE_UNITS]='reload reload-or-try-restart force-reload' + [RESTARTABLE_UNITS]='restart reload-or-restart' [JOBS]='cancel' [SNAPSHOTS]='delete' [ENVS]='set-environment unset-environment' @@ -110,6 +111,10 @@ _systemctl () { comps=$( __filter_units_by_property CanStart yes \ $( __get_inactive_units | grep -Ev '\.(device|snapshot)$' )) + elif __contains_word "$verb" ${VERBS[RESTARTABLE_UNITS]}; then + comps=$( __filter_units_by_property CanStart yes \ + $( __get_all_units | grep -Ev '\.(device|snapshot|socket|timer)$' )) + elif __contains_word "$verb" ${VERBS[STOPPABLE_UNITS]}; then comps=$( __filter_units_by_property CanStop yes \ $( __get_active_units ) )