From 9ce9dece4f10b29c5f442f033d967dbfae630880 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Thu, 25 Jul 2024 12:05:53 +0100 Subject: [PATCH] shell completion: add support for sd-analyze capability --mask Follow-up for 3e7a029c2856e7814b930443cc2d4fb089377592 --- shell-completion/bash/systemd-analyze | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/shell-completion/bash/systemd-analyze b/shell-completion/bash/systemd-analyze index 75ea1dc757c..91c46b256bd 100644 --- a/shell-completion/bash/systemd-analyze +++ b/shell-completion/bash/systemd-analyze @@ -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") ) -- 2.47.3