]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shell-completion: add offline/root/image to systemd-analyze
authorLuca Boccassi <luca.boccassi@microsoft.com>
Fri, 26 Nov 2021 18:07:37 +0000 (18:07 +0000)
committerLuca Boccassi <luca.boccassi@microsoft.com>
Fri, 26 Nov 2021 18:08:59 +0000 (18:08 +0000)
shell-completion/bash/systemd-analyze

index 1972441386e32107dd78f50c0521ac5f3f4551e5..350dcabb9486e971e2b8c3037190dfebde122da6 100644 (file)
@@ -145,14 +145,17 @@ _systemd_analyze() {
 
     elif __contains_word "$verb" ${VERBS[SECURITY]}; then
         if [[ $cur = -* ]]; then
-            comps='--help --version --no-pager --system --user -H --host -M --machine --offline --threshold --security-policy --json=off --json=pretty --json=short'
-        else
+            comps='--help --version --no-pager --system --user -H --host -M --machine --offline --threshold --security-policy --json=off --json=pretty --json=short --root --image'
+        elif ! __contains_word "--offline" ${COMP_WORDS[*]}; then
             if __contains_word "--user" ${COMP_WORDS[*]}; then
                 mode=--user
             else
                 mode=--system
             fi
             comps=$( __get_services $mode )
+        else
+            comps="$CONFIGS $( compgen -A file -- "$cur" )"
+            compopt -o filenames
         fi
 
     elif __contains_word "$verb" ${VERBS[CONDITION]}; then