diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-04-28 20:03:56 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-04-28 22:47:21 +0200 |
commit | 268f5a54630ef997d85f29a3ffc2b951f7a996c7 (patch) | |
tree | d5e9542deb01e2308ae95c75cb05945682aa64ef /src/core/unit-printf.c | |
parent | update TODO (diff) | |
download | systemd-268f5a54630ef997d85f29a3ffc2b951f7a996c7.tar.xz systemd-268f5a54630ef997d85f29a3ffc2b951f7a996c7.zip |
tree-wide: support a bunch of additional specifiers
Diffstat (limited to 'src/core/unit-printf.c')
-rw-r--r-- | src/core/unit-printf.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/core/unit-printf.c b/src/core/unit-printf.c index 7507479ce2..049a2f5596 100644 --- a/src/core/unit-printf.c +++ b/src/core/unit-printf.c @@ -186,8 +186,14 @@ int unit_name_printf(const Unit *u, const char* format, char **ret) { * %u: the username of the running user * * %m: the machine ID of the running system - * %H: the hostname of the running system * %b: the boot ID of the running system + * %H: the hostname of the running system + * %v: the kernel version + * %a: the native userspace architecture + * %o: the OS ID according to /etc/os-release + * %w: the OS version ID, according to /etc/os-release + * %B: the OS build ID, according to /etc/os-release + * %W: the OS variant ID, according to /etc/os-release */ const Specifier table[] = { @@ -203,8 +209,14 @@ int unit_name_printf(const Unit *u, const char* format, char **ret) { { 'u', specifier_user_name, NULL }, { 'm', specifier_machine_id, NULL }, - { 'H', specifier_host_name, NULL }, { 'b', specifier_boot_id, NULL }, + { 'H', specifier_host_name, NULL }, + { 'v', specifier_kernel_release, NULL }, + { 'a', specifier_architecture, NULL }, + { 'o', specifier_os_id, NULL }, + { 'w', specifier_os_version_id, NULL }, + { 'B', specifier_os_build_id, NULL }, + { 'W', specifier_os_variant_id, NULL }, {} }; |