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.
This commit is contained in:
Lennart Poettering
2023-11-07 20:07:43 +00:00
committed by Frantisek Sumsal
parent 38bf0a2361
commit a338ccaa98
+13 -5
View File
@@ -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();