shell-completion: add --when to systemctl
Fixes https://github.com/systemd/systemd/issues/41672
This commit is contained in:
@@ -137,7 +137,7 @@ _systemctl () {
|
||||
--show-transaction -T --mkdir --read-only'
|
||||
[ARG]='--host -H --kill-whom --property -p -P --signal -s --type -t --state --job-mode --root
|
||||
--preset-mode -n --lines -o --output -M --machine --message --timestamp --check-inhibitors --what
|
||||
--image --boot-loader-menu --boot-loader-entry --reboot-argument --kernel-cmdline --drop-in'
|
||||
--image --boot-loader-menu --boot-loader-entry --reboot-argument --kernel-cmdline --drop-in --when'
|
||||
)
|
||||
|
||||
if __contains_word "--user" ${COMP_WORDS[*]}; then
|
||||
@@ -202,6 +202,9 @@ _systemctl () {
|
||||
--boot-loader-entry)
|
||||
comps=$(systemctl --boot-loader-entry=help 2>/dev/null)
|
||||
;;
|
||||
--when)
|
||||
comps='show cancel auto'
|
||||
;;
|
||||
esac
|
||||
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
|
||||
return 0
|
||||
|
||||
@@ -542,4 +542,5 @@ _arguments -s \
|
||||
'--plain[When used with list-dependencies, print output as a list]' \
|
||||
'--failed[Show failed units]' \
|
||||
'--timestamp=[Change format of printed timestamps]:style:_systemctl_timestamp' \
|
||||
'--when=[Schedule halt/power-off/reboot/kexec action after a certain timestamp]:timestamp:(show cancel auto)' \
|
||||
'*::systemctl command:_systemctl_commands'
|
||||
|
||||
Reference in New Issue
Block a user