1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-26 17:27:41 +03:00

shell completion: add support for sd-analyze capability --mask

Follow-up for 3e7a029c28
This commit is contained in:
Luca Boccassi 2024-07-25 12:05:53 +01:00 committed by Luca Boccassi
parent a6bcab05df
commit 9ce9dece4f

View File

@ -67,7 +67,7 @@ _systemd_analyze() {
)
local -A VERBS=(
[STANDALONE]='time blame unit-files unit-paths exit-status capability compare-versions calendar timestamp timespan pcrs srk'
[STANDALONE]='time blame unit-files unit-paths exit-status compare-versions calendar timestamp timespan pcrs srk'
[CRITICAL_CHAIN]='critical-chain'
[DOT]='dot'
[DUMP]='dump'
@ -80,6 +80,7 @@ _systemd_analyze() {
[PLOT]='plot'
[ARCHITECTURES]='architectures'
[FDSTORE]='fdstore'
[CAPABILITY]='capability'
)
local CONFIGS='locale.conf systemd/bootchart.conf systemd/coredump.conf systemd/journald.conf
@ -219,6 +220,11 @@ _systemd_analyze() {
else
comps=$( __get_services $mode )
fi
elif __contains_word "$verb" ${VERBS[CAPABILITY]}; then
if [[ $cur = -* ]]; then
comps='--help --version --no-pager --json=off --json=pretty --json=short -m --mask'
fi
fi
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )