summaryrefslogtreecommitdiff
path: root/shell-completion
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2021-08-23 16:44:58 +0100
committerDaan De Meyer <daan.j.demeyer@gmail.com>2021-09-01 10:01:18 +0200
commit8de7929de5b70c4a130a0477c2f9baeecb86c905 (patch)
tree971a99f1722cf8f233905251e127a326ba1ff18b /shell-completion
parente11ca6bb4d30bbb6cfc09f4cb94adebc3f88ad50 (diff)
downloadsystemd-8de7929de5b70c4a130a0477c2f9baeecb86c905.tar.gz
mkosi: Add zsh to Arch packages
Useful for testing zsh completion changes.
Diffstat (limited to 'shell-completion')
-rw-r--r--shell-completion/bash/systemd-analyze15
1 files changed, 14 insertions, 1 deletions
diff --git a/shell-completion/bash/systemd-analyze b/shell-completion/bash/systemd-analyze
index 07d069a6d7..6bed5e73e8 100644
--- a/shell-completion/bash/systemd-analyze
+++ b/shell-completion/bash/systemd-analyze
@@ -55,13 +55,14 @@ _systemd_analyze() {
)
local -A VERBS=(
- [STANDALONE]='time blame plot dump unit-paths exit-status condition calendar timestamp timespan'
+ [STANDALONE]='time blame plot dump unit-paths exit-status calendar timestamp timespan'
[CRITICAL_CHAIN]='critical-chain'
[DOT]='dot'
[VERIFY]='verify'
[SECCOMP_FILTER]='syscall-filter'
[CAT_CONFIG]='cat-config'
[SECURITY]='security'
+ [CONDITION]='condition'
)
local CONFIGS='systemd/bootchart.conf systemd/coredump.conf systemd/journald.conf
@@ -153,6 +154,18 @@ _systemd_analyze() {
fi
comps=$( __get_services $mode )
fi
+
+ elif __contains_word "$verb" ${VERBS[CONDITION]}; then
+ if [[ $cur = -* ]]; then
+ comps='--help --version --system --user --global --no-pager --root --image'
+ elif [[ $prev = "-u" ]] || [[ $prev = "--unit" ]]; then
+ if __contains_word "--user" ${COMP_WORDS[*]}; then
+ mode=--user
+ else
+ mode=--system
+ fi
+ comps=$( __get_services $mode )
+ fi
fi
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )