From 37a92352d6bbac65ca6b1b3c958939a4ccc7d51a Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 28 Nov 2019 10:51:31 +0100 Subject: [PATCH 1/2] nspawn: highlight description string in --help text We do so in most tools now, do so here, too. --- src/nspawn/nspawn.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 7f44272a88..873a76596f 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -290,7 +290,7 @@ static int help(void) { return log_oom(); printf("%1$s [OPTIONS...] [PATH] [ARGUMENTS...]\n\n" - "Spawn a command or OS in a light-weight container.\n\n" + "%5$sSpawn a command or OS in a light-weight container.%6$s\n\n" " -h --help Show this help\n" " --version Print version string\n" " -q --quiet Do not show status information\n" @@ -405,7 +405,9 @@ static int help(void) { "\nSee the %2$s for details.\n" , program_invocation_short_name , link - , ansi_underline(), ansi_normal()); + , ansi_underline(), ansi_normal() + , ansi_highlight(), ansi_normal() + ); return 0; } From 6f63c5b8b10a4ead4a567c174d5988e5985d12ef Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 28 Nov 2019 10:51:05 +0100 Subject: [PATCH 2/2] notify: add color to --help We do that for most tools now, do so here now, too. --- src/notify/notify.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/notify/notify.c b/src/notify/notify.c index c2e7683bcf..a76f337695 100644 --- a/src/notify/notify.c +++ b/src/notify/notify.c @@ -17,6 +17,7 @@ #include "pretty-print.h" #include "string-util.h" #include "strv.h" +#include "terminal-util.h" #include "user-util.h" #include "util.h" @@ -35,8 +36,8 @@ static int help(void) { if (r < 0) return log_oom(); - printf("%s [OPTIONS...] [VARIABLE=VALUE...]\n\n" - "Notify the init system about service status updates.\n\n" + printf("%s [OPTIONS...] [VARIABLE=VALUE...]\n" + "\n%sNotify the init system about service status updates.%s\n\n" " -h --help Show this help\n" " --version Show package version\n" " --ready Inform the init system about service start-up completion\n" @@ -46,6 +47,7 @@ static int help(void) { " --booted Check if the system was booted up with systemd\n" "\nSee the %s for details.\n" , program_invocation_short_name + , ansi_highlight(), ansi_normal() , link );