From: Lennart Poettering Date: Wed, 6 May 2020 12:56:37 +0000 (+0200) Subject: systemctl: ensure underline for "list-unit-files" empty cells X-Git-Tag: v246-rc1~429^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=45d82c3f1c47b79898b03ee89062d502e720b8d5;p=thirdparty%2Fsystemd.git systemctl: ensure underline for "list-unit-files" empty cells --- diff --git a/src/basic/terminal-util.h b/src/basic/terminal-util.h index c7570c7a617..67634b4d469 100644 --- a/src/basic/terminal-util.h +++ b/src/basic/terminal-util.h @@ -28,6 +28,7 @@ #define ANSI_HIGHLIGHT_YELLOW4 "\x1B[0;1;38;5;100m" /* Underlined */ +#define ANSI_GREY_UNDERLINE "\x1B[0;4;38;5;245m" #define ANSI_HIGHLIGHT_RED_UNDERLINE "\x1B[0;1;4;31m" #define ANSI_HIGHLIGHT_GREEN_UNDERLINE "\x1B[0;1;4;32m" #define ANSI_HIGHLIGHT_YELLOW_UNDERLINE "\x1B[0;1;4;38;5;185m" @@ -138,6 +139,7 @@ DEFINE_ANSI_FUNC(highlight_grey, HIGHLIGHT_GREY); DEFINE_ANSI_FUNC_UNDERLINE(underline, UNDERLINE, NORMAL); DEFINE_ANSI_FUNC_UNDERLINE(highlight_underline, HIGHLIGHT_UNDERLINE, HIGHLIGHT); +DEFINE_ANSI_FUNC_UNDERLINE(grey_underline, GREY_UNDERLINE, GREY); DEFINE_ANSI_FUNC_UNDERLINE(highlight_red_underline, HIGHLIGHT_RED_UNDERLINE, HIGHLIGHT_RED); DEFINE_ANSI_FUNC_UNDERLINE(highlight_green_underline, HIGHLIGHT_GREEN_UNDERLINE, HIGHLIGHT_GREEN); DEFINE_ANSI_FUNC_UNDERLINE(highlight_yellow_underline, HIGHLIGHT_YELLOW_UNDERLINE, HIGHLIGHT_YELLOW); diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 07b0fdd2c5b..807a4974277 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -1546,8 +1546,9 @@ static int output_unit_file_list(const UnitFileList *units, unsigned c) { TABLE_STRING, unit_preset_str, TABLE_SET_COLOR, strempty(on_preset_color)); } else - r = table_add_many(table, TABLE_EMPTY); - + r = table_add_many(table, + TABLE_EMPTY, + TABLE_SET_COLOR, underline ? ansi_grey_underline() : ansi_grey()); if (r < 0) return table_log_add_error(r); }