X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=sidebyside;f=shell-completion%2Fbash%2Fsystemctl;h=ceca3348eddc2d1c6dd23aafd5a2417459356cfa;hb=98a6e132b5b85999f7e3dce158e826ffeecc1553;hp=f5829b72f80fb2fd9a971e84c6d627f146429655;hpb=bf83067c1ded45c1ba1d9d679e6190a5de51f960;p=elogind.git diff --git a/shell-completion/bash/systemctl b/shell-completion/bash/systemctl index f5829b72f..ceca3348e 100644 --- a/shell-completion/bash/systemctl +++ b/shell-completion/bash/systemctl @@ -70,7 +70,7 @@ _systemctl () { local i verb comps mode local -A OPTS=( - [STANDALONE]='--all -a --defaults --fail --ignore-dependencies --failed --force -f --full --global + [STANDALONE]='--all -a --reverse --after --before --defaults --fail --ignore-dependencies --failed --force -f --full -l --global --help -h --no-ask-password --no-block --no-legend --no-pager --no-reload --no-wall --quiet -q --privileged -P --system --user --version --runtime' [ARG]='--host -H --kill-mode --kill-who --property -p --signal -s --type -t --root' @@ -117,7 +117,7 @@ _systemctl () { fi local -A VERBS=( - [ALL_UNITS]='is-active is-failed is-enabled status show mask preset help' + [ALL_UNITS]='is-active is-failed is-enabled status show mask preset help list-dependencies' [ENABLED_UNITS]='disable' [DISABLED_UNITS]='enable' [REENABLABLE_UNITS]='reenable' @@ -134,9 +134,10 @@ _systemctl () { [STANDALONE]='daemon-reexec daemon-reload default dump emergency exit halt hibernate hybrid-sleep kexec list-jobs list-units list-unit-files poweroff reboot rescue - show-environment suspend' + show-environment suspend get-default' [NAME]='snapshot load' [FILE]='link' + [TARGETS]='set-default' ) for ((i=0; $i <= $COMP_CWORD; i++)); do @@ -210,6 +211,9 @@ _systemctl () { elif __contains_word "$verb" ${VERBS[FILE]}; then comps=$( compgen -A file -- "$cur" ) compopt -o filenames + elif __contains_word "$verb" ${VERBS[TARGETS]}; then + comps=$( __systemctl $mode list-unit-files --type target --full --all \ + | { while read -r a b; do echo " $a"; done; } ) fi COMPREPLY=( $(compgen -W '$comps' -- "$cur") )