diff options
author | Paweł Marciniak <sunwire+git@gmail.com> | 2021-06-26 17:50:16 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-06-28 20:11:52 +0200 |
commit | 580e198a50449e892aa110c81d74f277d2ae8fa0 (patch) | |
tree | c8a2ff134893f79056ed86c72faf27b8817f0654 | |
parent | 2e9ee9cf15ffe9e4fed61818b6ec80e1e370af4e (diff) | |
download | systemd-580e198a50449e892aa110c81d74f277d2ae8fa0.tar.gz |
core: add combined status unit format
[zjs: actual implementation is stripped out and will be added in subsequent
commits.]
-rw-r--r-- | man/systemd-system.conf.xml | 10 | ||||
-rw-r--r-- | man/systemd.xml | 8 | ||||
-rw-r--r-- | meson_options.txt | 2 | ||||
-rw-r--r-- | src/core/show-status.c | 1 | ||||
-rw-r--r-- | src/core/show-status.h | 1 |
5 files changed, 14 insertions, 8 deletions
diff --git a/man/systemd-system.conf.xml b/man/systemd-system.conf.xml index 2851bae31e..9ad309a7e3 100644 --- a/man/systemd-system.conf.xml +++ b/man/systemd-system.conf.xml @@ -257,10 +257,12 @@ <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> diff --git a/man/systemd.xml b/man/systemd.xml index 5f1642ee9d..cd50cd4265 100644 --- a/man/systemd.xml +++ b/man/systemd.xml @@ -840,9 +840,11 @@ <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> diff --git a/meson_options.txt b/meson_options.txt index 5048de755d..163c8df87d 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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') diff --git a/src/core/show-status.c b/src/core/show-status.c index a74423cb85..df25429938 100644 --- a/src/core/show-status.c +++ b/src/core/show-status.c @@ -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); diff --git a/src/core/show-status.h b/src/core/show-status.h index dfcf5f4103..f441223dff 100644 --- a/src/core/show-status.h +++ b/src/core/show-status.h @@ -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; |