]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shell-completion: bash: Add systemd-analyze calendar options 39778/head
authorSimon Barth <simon.barth@gmx.de>
Tue, 11 Nov 2025 19:59:30 +0000 (20:59 +0100)
committerSimon Barth <simon.barth@gmx.de>
Tue, 18 Nov 2025 22:05:02 +0000 (23:05 +0100)
Add completion for the systemd-analyze calendar options --iterations and
--base-time.

shell-completion/bash/systemd-analyze

index a6861013b8dd9ae57d6717b8e4cafddbcbe7b56a..a863af7affd768d0862b9f5e097bd455688b7a15 100644 (file)
@@ -77,7 +77,7 @@ _systemd_analyze() {
     )
 
     local -A VERBS=(
-        [STANDALONE]='time blame unit-files unit-paths exit-status compare-versions calendar timestamp timespan pcrs nvpcrs srk has-tpm2 smbios11 chid image-policy'
+        [STANDALONE]='time blame unit-files unit-paths exit-status compare-versions timestamp timespan pcrs nvpcrs srk has-tpm2 smbios11 chid image-policy'
         [CRITICAL_CHAIN]='critical-chain'
         [DOT]='dot'
         [DUMP]='dump'
@@ -96,6 +96,7 @@ _systemd_analyze() {
         [UNIT_SHELL]='unit-shell'
         [UNIT_GDB]='unit-gdb'
         [FILESYSTEMS]='filesystems'
+        [CALENDAR]='calendar'
     )
 
     local CONFIGS='locale.conf systemd/bootchart.conf systemd/coredump.conf systemd/journald.conf
@@ -282,6 +283,11 @@ _systemd_analyze() {
         else
             comps=$( __get_filesystem_sets )
         fi
+
+    elif __contains_word "$verb" ${VERBS[CALENDAR]}; then
+        if [[ $cur = -* ]]; then
+            comps='--help --version --iterations --base-time'
+        fi
     fi
 
     COMPREPLY=( $(compgen -W '$comps' -- "$cur") )