]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shell completion: add support for sd-analyze capability --mask
authorLuca Boccassi <bluca@debian.org>
Thu, 25 Jul 2024 11:05:53 +0000 (12:05 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 25 Jul 2024 12:22:27 +0000 (13:22 +0100)
Follow-up for 3e7a029c2856e7814b930443cc2d4fb089377592

shell-completion/bash/systemd-analyze

index 75ea1dc757c2bb0fbd25a3643f01d1031d79f385..91c46b256bdcd208df507830e6ce6cb63033121c 100644 (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") )