shell-completion: bash: Add systemd-analyze calendar options

Add completion for the systemd-analyze calendar options --iterations and
--base-time.
This commit is contained in:
Simon Barth
2025-11-11 20:59:30 +01:00
parent 62aba7c5cd
commit a049825708

View 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") )