From 7f9dd1366e755ff90796acef478630a7b7e54a9c Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Fri, 15 May 2026 17:40:28 +0100 Subject: [PATCH] shell-completion: add --when to systemctl Fixes https://github.com/systemd/systemd/issues/41672 --- shell-completion/bash/systemctl.in | 5 ++++- shell-completion/zsh/_systemctl.in | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/shell-completion/bash/systemctl.in b/shell-completion/bash/systemctl.in index 9f52115b73..748126ea14 100644 --- a/shell-completion/bash/systemctl.in +++ b/shell-completion/bash/systemctl.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 diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in index 828e74c2af..ca8b218c2c 100644 --- a/shell-completion/zsh/_systemctl.in +++ b/shell-completion/zsh/_systemctl.in @@ -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'