apparmor.d/root/usr/share/zsh/site-functions/_aa-log.zsh

24 lines
456 B
Bash
Raw Normal View History

2021-04-02 11:43:03 +02:00
#compdef aa-log
#autoload
_aa-log() {
2021-04-02 11:43:03 +02:00
local IFS=$'\n'
_arguments : \
-f'[set a logfile or a prefix to the default log file]:FILE:__aa_files' \
2022-10-15 18:29:49 +02:00
-s'[parse systemd dbus logs]' \
-h'[display help information]'
2021-04-02 11:43:03 +02:00
_values -C 'profile names' ${$(__aa_profiles):-""}
}
__aa_files() {
find /var/log/audit/ -type f -printf '%P\n' | cut -d '.' -f 3
_files
}
2021-04-02 11:43:03 +02:00
__aa_profiles() {
find -L /etc/apparmor.d -maxdepth 1 -type f -printf '%P\n' | sort
2021-04-02 11:43:03 +02:00
}
_aa-log