]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: add combined status unit format
authorPaweł Marciniak <sunwire+git@gmail.com>
Sat, 26 Jun 2021 15:50:16 +0000 (17:50 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 28 Jun 2021 18:11:52 +0000 (20:11 +0200)
[zjs: actual implementation is stripped out and will be added in subsequent
commits.]

man/systemd-system.conf.xml
man/systemd.xml
meson_options.txt
src/core/show-status.c
src/core/show-status.h

index 2851bae31e7fa8e5f353ca6270a6242e85d95576..9ad309a7e3d248fdb219b6124ae68bf24f465cbc 100644 (file)
       <varlistentry>
         <term><varname>StatusUnitFormat=</varname></term>
 
-        <listitem><para>Takes either <option>name</option> or <option>description</option> as the value. If
-        <option>name</option>, the system manager will use unit names in status messages, instead of the
-        longer and more informative descriptions set with <varname>Description=</varname>, see
-        <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
+        <listitem><para>Takes <option>name</option>, <option>description</option> or
+        <option>combined</option> as the value. If <option>name</option>, the system manager will use unit
+        names in status messages, instead of the longer and more informative descriptions set with
+        <varname>Description=</varname>, see
+        <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>. If
+        <option>combined</option>, the system manager will use unit names and description in status messages.
         </para></listitem>
       </varlistentry>
 
index 5f1642ee9de27fc78677f3b6bc0e92efa286e395..cd50cd426585904ecc28e3fff75a4c6c0aea9512 100644 (file)
       <varlistentry>
         <term><varname>systemd.status_unit_format=</varname></term>
 
-        <listitem><para>Takes either <option>name</option> or <option>description</option> as the value. If
-        <option>name</option>, the system manager will use unit names in status messages. If specified,
-        overrides the system manager configuration file option <option>StatusUnitFormat=</option>, see
+        <listitem><para>Takes <option>name</option>, <option>description</option> or
+        <option>combined</option> as the value. If <option>name</option>, the system manager will use unit
+        names in status messages. If <option>combined</option>, the system manager will use unit names and
+        description in status messages. When specified, overrides the system manager configuration file
+        option <option>StatusUnitFormat=</option>, see
         <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
         </para></listitem>
       </varlistentry>
index 5048de755d917f8ac7337f78252e997b473b4446..163c8df87db56b90637221656d0ac01b13f3fbd7 100644 (file)
@@ -200,7 +200,7 @@ option('default-net-naming-scheme', type : 'combo',
        choices : ['latest', 'v238', 'v239', 'v240'],
        description : 'default net.naming-scheme= value')
 option('status-unit-format-default', type : 'combo',
-       choices : ['description', 'name'],
+       choices : ['description', 'name', 'combined'],
        description : 'use unit name or description in messages by default')
 option('time-epoch', type : 'integer', value : '-1',
        description : 'time epoch for time clients')
index a74423cb85d5455923477640883eae288857afd9..df2542993894af6baaca34bd6b120e9f90726224 100644 (file)
@@ -123,6 +123,7 @@ int status_printf(const char *status, ShowStatusFlags flags, const char *format,
 static const char* const status_unit_format_table[_STATUS_UNIT_FORMAT_MAX] = {
         [STATUS_UNIT_FORMAT_NAME]        = "name",
         [STATUS_UNIT_FORMAT_DESCRIPTION] = "description",
+        [STATUS_UNIT_FORMAT_COMBINED]    = "combined",
 };
 
 DEFINE_STRING_TABLE_LOOKUP(status_unit_format, StatusUnitFormat);
index dfcf5f4103eee1a9cfb948ff3c291f735c330828..f441223dff6a23fe7d3685ce776fadb89d5d526f 100644 (file)
@@ -25,6 +25,7 @@ typedef enum ShowStatusFlags {
 typedef enum StatusUnitFormat {
         STATUS_UNIT_FORMAT_NAME,
         STATUS_UNIT_FORMAT_DESCRIPTION,
+        STATUS_UNIT_FORMAT_COMBINED,
         _STATUS_UNIT_FORMAT_MAX,
         _STATUS_UNIT_FORMAT_INVALID = -EINVAL,
 } StatusUnitFormat;