shell-completion: add --when to systemctl

Fixes https://github.com/systemd/systemd/issues/41672
This commit is contained in:
Luca Boccassi
2026-05-15 19:07:00 +01:00
parent 053470f2db
commit 7f9dd1366e
2 changed files with 5 additions and 1 deletions
+4 -1
View File
@@ -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
+1
View File
@@ -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'