chiark / gitweb /
systemctl: tweak output of Listen: fields a bit
authorLennart Poettering <lennart@poettering.net>
Fri, 5 Apr 2013 18:12:39 +0000 (20:12 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 5 Apr 2013 18:12:39 +0000 (20:12 +0200)
It's probably a good idea to minimize the number of field names to show
in the "systemctl status" output, in order to make them useful as a
guide for the reader how things are "grouped". This patch moves
information about the used socket technology to the end of the output
lines in brackets, rather than into the field names. This turns the used
socket technology into what it is -- peripheral meta information --
instead of something that was at the core.

New output:

systemd-journald.socket - Journal Socket
         Loaded: loaded (/usr/lib/systemd/system/systemd-journald.socket; static)
         Active: active (running) since Fr 2013-03-29 02:16:30 CET; 1 weeks 0 days ago
           Docs: man:systemd-journald.service(8)
                 man:journald.conf(5)
                 man:systemd-journald.service(8)
                 man:journald.conf(5)
         Listen: /run/systemd/journal/stdout (Stream)
                 /run/systemd/journal/socket (Datagram)
                 /dev/log (Datagram)

src/systemctl/systemctl.c

index a7b541dc3f0bf9da029001d04b14c499e4e2496c..6a4c968f9857a441b72c1850eb812f479f60d78e 100644 (file)
@@ -2420,7 +2420,7 @@ static void print_status_info(UnitStatusInfo *i) {
                 printf(" %*s %s\n", maxlen+1, t == i->documentation ? "Docs:" : "", *t);
 
         STRV_FOREACH_PAIR(t, t2, i->listen)
-                printf(" %*s%s: %s\n", maxlen - (int)strlen(*t), "Listen", *t, *t2);
+                printf(" %*s %s (%s)\n", maxlen+1, t == i->listen ? "Listen:" : "", *t2, *t);
 
         if (i->accept)
                 printf(" %*s: %u; Connected: %u\n", maxlen, "Accepted", i->n_accepted, i->n_connections);