]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
various: use "-" instead of "n/a" in tables
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 17 Sep 2022 09:06:39 +0000 (11:06 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 17 Sep 2022 11:05:51 +0000 (13:05 +0200)
In the context of a table, both would be generally understood to have the same
meaning. "n/a" is a strange beast. It was useful when tables were produced on
the typewriter with "---------" used to separate rows. It is visually more
pleasing to use "-", and there is no risk of it being mistaken for a row
separator.

man/coredumpctl.xml
man/systemctl.xml
src/shared/format-table.c

index 2a1f654112553d47f8b9061429c156b0a7946339..903565764e276c6d93d3cdd3fadfddb0257bc9cc 100644 (file)
       <title>List all the core dumps of a program</title>
 
       <programlisting>$ coredumpctl list /usr/lib64/firefox/firefox
-TIME     PID  UID  GID SIG     COREFILE EXE                         SIZE
-Tue …   8018 1000 1000 SIGSEGV missing  /usr/lib64/firefox/firefox   n/a
-Wed … 251609 1000 1000 SIGTRAP missing  /usr/lib64/firefox/firefox   n/a
+TIME       PID  UID  GID SIG     COREFILE EXE                         SIZE
+Tue …   8018 1000 1000 SIGSEGV missing  /usr/lib64/firefox/firefox     -
+Wed … 251609 1000 1000 SIGTRAP missing  /usr/lib64/firefox/firefox     -
 Fri … 552351 1000 1000 SIGSEGV present  /usr/lib64/firefox/firefox 28.7M
 </programlisting>
 
index 5c0e743d812e7f31f96039eb7aeb2a467194e144..a7cd6398afa8f3832f795a2cc7709b003405f336 100644 (file)
@@ -159,7 +159,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
             Produces output similar to
             <programlisting>
 NEXT                         LEFT          LAST                         PASSED     UNIT                         ACTIVATES
-n/a                          n/a           Thu 2017-02-23 13:40:29 EST  3 days ago ureadahead-stop.timer        ureadahead-stop.service
+-                            -             Thu 2017-02-23 13:40:29 EST  3 days ago ureadahead-stop.timer        ureadahead-stop.service
 Sun 2017-02-26 18:55:42 EST  1min 14s left Thu 2017-02-23 13:54:44 EST  3 days ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
 Sun 2017-02-26 20:37:16 EST  1h 42min left Sun 2017-02-26 11:56:36 EST  6h ago     apt-daily.timer              apt-daily.service
 Sun 2017-02-26 20:57:49 EST  2h 3min left  Sun 2017-02-26 11:56:36 EST  6h ago     snapd.refresh.timer          snapd.refresh.service
index d4e66cb6a4957bfacb3f3b6ad7a6a400fd204b57..47bc90b9fc3209bc78a4b218502a43077a024a44 100644 (file)
@@ -1464,7 +1464,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas
                 else
                         ret = format_timestamp_relative(p, FORMAT_TIMESTAMP_RELATIVE_MAX, d->timestamp);
                 if (!ret)
-                        return "n/a";
+                        return "-";
 
                 d->formatted = TAKE_PTR(p);
                 break;
@@ -1480,7 +1480,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas
 
                 if (!format_timespan(p, FORMAT_TIMESPAN_MAX, d->timespan,
                                      d->type == TABLE_TIMESPAN ? 0 : USEC_PER_MSEC))
-                        return "n/a";
+                        return "-";
 
                 d->formatted = TAKE_PTR(p);
                 break;
@@ -1494,7 +1494,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas
                         return NULL;
 
                 if (!format_bytes(p, FORMAT_BYTES_MAX, d->size))
-                        return "n/a";
+                        return "-";
 
                 d->formatted = TAKE_PTR(p);
                 break;
@@ -1509,7 +1509,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas
                         return NULL;
 
                 if (!format_bytes_full(p, FORMAT_BYTES_MAX, d->size, 0))
-                        return "n/a";
+                        return "-";
 
                 n = strlen(p);
                 strscpy(p + n, FORMAT_BYTES_MAX + 2 - n, "bps");
@@ -1710,7 +1710,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas
                 char *p;
 
                 if (!uid_is_valid(d->uid))
-                        return "n/a";
+                        return "-";
 
                 p = new(char, DECIMAL_STR_WIDTH(d->uid) + 1);
                 if (!p)
@@ -1725,7 +1725,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas
                 char *p;
 
                 if (!gid_is_valid(d->gid))
-                        return "n/a";
+                        return "-";
 
                 p = new(char, DECIMAL_STR_WIDTH(d->gid) + 1);
                 if (!p)
@@ -1740,7 +1740,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas
                 char *p;
 
                 if (!pid_is_valid(d->pid))
-                        return "n/a";
+                        return "-";
 
                 p = new(char, DECIMAL_STR_WIDTH(d->pid) + 1);
                 if (!p)
@@ -1757,7 +1757,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas
 
                 suffix = signal_to_string(d->int_val);
                 if (!suffix)
-                        return "n/a";
+                        return "-";
 
                 p = strjoin("SIG", suffix);
                 if (!p)
@@ -1771,7 +1771,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas
                 char *p;
 
                 if (d->mode == MODE_INVALID)
-                        return "n/a";
+                        return "-";
 
                 p = new(char, 4 + 1);
                 if (!p)