aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Werkmeister <mail@lucaswerkmeister.de>2018-09-30 22:27:27 +0200
committerLucas Werkmeister <mail@lucaswerkmeister.de>2018-09-30 22:27:27 +0200
commit2431ca22bcb5105c469d1c78984d9ba4c59a247c (patch)
treec11b2ab2f913e7a1ad5ee4addf6249d03fe6b86b /shell-completion
parenttrivial: fix spelling in code comments (diff)
downloadsystemd-2431ca22bcb5105c469d1c78984d9ba4c59a247c.tar.gz
systemd-2431ca22bcb5105c469d1c78984d9ba4c59a247c.tar.bz2
systemd-2431ca22bcb5105c469d1c78984d9ba4c59a247c.zip
bash-completion: analyze: complete system call sets
Diffstat (limited to 'shell-completion')
-rw-r--r--shell-completion/bash/systemd-analyze11
1 files changed, 11 insertions, 0 deletions
diff --git a/shell-completion/bash/systemd-analyze b/shell-completion/bash/systemd-analyze
index 4bc146aa0..c650940bc 100644
--- a/shell-completion/bash/systemd-analyze
+++ b/shell-completion/bash/systemd-analyze
@@ -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