]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bash-completion: analyze: complete system call sets 10221/head
authorLucas Werkmeister <mail@lucaswerkmeister.de>
Sun, 30 Sep 2018 20:27:27 +0000 (22:27 +0200)
committerLucas Werkmeister <mail@lucaswerkmeister.de>
Sun, 30 Sep 2018 20:27:27 +0000 (22:27 +0200)
shell-completion/bash/systemd-analyze

index 4bc146aa06f16833b5913b097a59b1b0a5a96d0b..c650940bcf0deb3ca7a90ecf42905e9c80827602 100644 (file)
@@ -30,6 +30,15 @@ __get_machines() {
         machinectl list --no-legend --no-pager | { while read a b; do echo " $a"; done; };
 }
 
+__get_syscall_sets() {
+        local line
+        systemd-analyze syscall-filter --no-pager | while IFS= read -r line; do
+                if [[ $line == @* ]]; then
+                        printf '%s\n' "$line"
+                fi
+        done
+}
+
 _systemd_analyze() {
         local i verb comps
         local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
@@ -121,6 +130,8 @@ _systemd_analyze() {
         elif __contains_word "$verb" ${VERBS[SECCOMP_FILTER]}; then
                 if [[ $cur = -* ]]; then
                         comps='--help --version --no-pager'
+                else
+                        comps=$( __get_syscall_sets )
                 fi
 
         elif __contains_word "$verb" ${VERBS[VERIFY]}; then