diff options
author | Václav Pavlín <vpavlin@redhat.com> | 2013-05-28 11:05:48 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-05-30 20:44:41 -0400 |
commit | 99504dd4c13af7516a976fffc0f68e6f26d3faac (patch) | |
tree | b0650f8436617bb48701353f28310ac7f9a62de9 /shell-completion | |
parent | 9749cd77bc6121a304a7f1eb0f03f26e620dc9da (diff) |
systemctl: add commands set-default and get-default
systemctl set-default NAME links the default.target to the given unit,
get-default prints out the path to the currently set default target.
Diffstat (limited to 'shell-completion')
-rw-r--r-- | shell-completion/bash/systemctl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/shell-completion/bash/systemctl b/shell-completion/bash/systemctl index 191b8d13ec..a05b756980 100644 --- a/shell-completion/bash/systemctl +++ b/shell-completion/bash/systemctl @@ -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") ) |