From: Lennart Poettering Date: Tue, 12 Nov 2024 11:48:54 +0000 (+0100) Subject: dissect: add a bit of color to --discover table X-Git-Tag: v258-rc1~1733^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8ef117ff4b1fe2aa713b8ce03c51a4f9168c5627;p=thirdparty%2Fsystemd.git dissect: add a bit of color to --discover table --- 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); }