]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: grey out legend
authorLennart Poettering <lennart@poettering.net>
Tue, 7 Nov 2023 16:34:08 +0000 (17:34 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 7 Nov 2023 20:07:43 +0000 (20:07 +0000)
The legend is not the primary information, but simply explanatory, hence
grey it out a bit.

This mimics what we do for pcrlock.

src/systemctl/systemctl-list-units.c

index 77ff836bb095be8c4725c9e2a0461515b14b375c..34abc3cc9b3a31c6bf3b4adb337b6098b8c0ee3c 100644 (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();