]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
analyze: add some minimal ANSI highlighting of syscall-filter output 10777/head
authorLennart Poettering <lennart@poettering.net>
Wed, 14 Nov 2018 18:59:27 +0000 (19:59 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 16 Nov 2018 15:10:57 +0000 (16:10 +0100)
src/analyze/analyze.c

index 89f0891b86868a8904f99742240546db60d88457..f82c5023d52e4f1d3cff7f851e0a60713a8a1568 100644 (file)
@@ -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);