]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: show service status string in other color
authorLennart Poettering <lennart@poettering.net>
Fri, 24 Mar 2023 21:52:51 +0000 (22:52 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 28 Mar 2023 04:40:47 +0000 (13:40 +0900)
Let's add a dash of colour to separate our own status info from the the
status info supplied by the service.

(I wanted to make this italics, but apparently popular terminal
emulators don't support that, such as xterm)

src/systemctl/systemctl-show.c

index fdc950a9e323717736f0b40c6aeebcdf0b9beb71..4a14c105dd733c065350113b6084f0c3726b8e44 100644 (file)
@@ -681,7 +681,7 @@ static void print_status_info(
         }
 
         if (i->status_text)
-                printf("     Status: \"%s\"\n", i->status_text);
+                printf("     Status: \"%s%s%s\"\n", ansi_highlight_cyan(), i->status_text, ansi_normal());
         if (i->status_errno > 0) {
                 errno = i->status_errno;
                 printf("      Error: %i (%m)\n", i->status_errno);