]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shell-completion: add --when to systemctl
authorLuca Boccassi <luca.boccassi@gmail.com>
Fri, 15 May 2026 16:40:28 +0000 (17:40 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 15 May 2026 18:07:00 +0000 (19:07 +0100)
Fixes https://github.com/systemd/systemd/issues/41672

shell-completion/bash/systemctl.in
shell-completion/zsh/_systemctl.in

index 9f52115b7328ad438e32aa173db3d7cab122505a..748126ea14a74f0ae86f41fb48ea442eaefcd463 100644 (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
index 828e74c2af15d9267293eaa85473587528930029..ca8b218c2cecc4a59dc7eb1f1e00c427f4780dd4 100644 (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'