From: Lennart Poettering Date: Tue, 7 Nov 2023 16:34:08 +0000 (+0100) Subject: systemctl: grey out legend X-Git-Tag: v255-rc2~95 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a338ccaa980a83e013c8f482d4b2ba4c8b50420a;p=thirdparty%2Fsystemd.git systemctl: grey out legend The legend is not the primary information, but simply explanatory, hence grey it out a bit. This mimics what we do for pcrlock. --- diff --git a/src/systemctl/systemctl-list-units.c b/src/systemctl/systemctl-list-units.c index 77ff836bb09..34abc3cc9b3 100644 --- a/src/systemctl/systemctl-list-units.c +++ b/src/systemctl/systemctl-list-units.c @@ -193,14 +193,22 @@ static int output_units_list(const UnitInfo *unit_infos, size_t c) { size_t records = table_get_rows(table) - 1; if (records > 0) { - puts("\n" - "LOAD = Reflects whether the unit definition was properly loaded.\n" - "ACTIVE = The high-level unit activation state, i.e. generalization of SUB.\n" - "SUB = The low-level unit activation state, values depend on unit type."); + printf("\n" + "%1$sLegend: LOAD %2$s Reflects whether the unit definition was properly loaded.%3$s\n" + "%1$s ACTIVE %2$s The high-level unit activation state, i.e. generalization of SUB.%3$s\n" + "%1$s SUB %2$s The low-level unit activation state, values depend on unit type.%3$s\n", + ansi_grey(), + special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + ansi_normal()); if (job_count > 0) - puts("JOB = Pending job for the unit.\n"); + printf("%s JOB %s Pending job for the unit.%s\n", + ansi_grey(), + special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + ansi_normal()); } + putchar('\n'); + on = records > 0 ? ansi_highlight() : ansi_highlight_red(); off = ansi_normal();