From a9bfb3eff2859dd2d187fc38308bfc05b270c869 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 14 Nov 2018 19:59:27 +0100 Subject: [PATCH] analyze: add some minimal ANSI highlighting of syscall-filter output --- src/analyze/analyze.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index 89f0891b868..f82c5023d52 100644 --- a/src/analyze/analyze.c +++ b/src/analyze/analyze.c @@ -1556,10 +1556,18 @@ static void kernel_syscalls_remove(Set *s, const SyscallFilterSet *set) { static void dump_syscall_filter(const SyscallFilterSet *set) { const char *syscall; - printf("%s\n", set->name); - printf(" # %s\n", set->help); + printf("%s%s%s\n" + " # %s\n", + ansi_highlight(), + set->name, + ansi_normal(), + set->help); + NULSTR_FOREACH(syscall, set->value) - printf(" %s\n", syscall); + printf(" %s%s%s\n", + syscall[0] == '@' ? ansi_underline() : "", + syscall, + ansi_normal()); } static int dump_syscall_filters(int argc, char *argv[], void *userdata) { @@ -1592,7 +1600,8 @@ static int dump_syscall_filters(int argc, char *argv[], void *userdata) { Iterator j; printf("\n" - "# Unlisted System Calls (supported by the local kernel, but not included in any of the groups listed above):\n"); + "# %sUnlisted System Calls%s (supported by the local kernel, but not included in any of the groups listed above):\n", + ansi_highlight(), ansi_normal()); SET_FOREACH(syscall, kernel, j) printf("# %s\n", syscall); -- 2.47.3