mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-06 21:51:37 +00:00
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.
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
9749cd77bc
commit
99504dd4c1
@@ -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") )
|
||||
|
||||
Reference in New Issue
Block a user