From 8ef117ff4b1fe2aa713b8ce03c51a4f9168c5627 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 12 Nov 2024 12:48:54 +0100 Subject: [PATCH] dissect: add a bit of color to --discover table --- src/dissect/dissect.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dissect/dissect.c b/src/dissect/dissect.c index cdc4f770159..3ca81a6a218 100644 --- a/src/dissect/dissect.c +++ b/src/dissect/dissect.c @@ -1903,12 +1903,15 @@ static int action_discover(void) { r = table_add_many( t, TABLE_STRING, img->name, + TABLE_SET_COLOR, startswith(img->name, ".") ? ANSI_GREY : NULL, TABLE_STRING, image_type_to_string(img->type), TABLE_STRING, image_class_to_string(img->class), TABLE_BOOLEAN, img->read_only, + TABLE_SET_COLOR, !img->read_only ? ANSI_HIGHLIGHT_GREEN : ANSI_HIGHLIGHT_RED, TABLE_PATH, img->path, TABLE_TIMESTAMP, img->mtime != 0 ? img->mtime : img->crtime, - TABLE_SIZE, img->usage); + TABLE_SIZE, img->usage, + TABLE_SET_COLOR, img->usage <= 0 ? ANSI_HIGHLIGHT_RED : NULL); if (r < 0) return table_log_add_error(r); } -- 2.47.3