From f37df1b60e7bc3b5aa568701fa676fe8d4c6ceb1 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 6 Mar 2025 11:42:11 +0100 Subject: [PATCH] hostnamectl: add usual ansi underlining to --help text --- src/hostname/hostnamectl.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c index 88f068114ec..adf3a3296ff 100644 --- a/src/hostname/hostnamectl.c +++ b/src/hostname/hostnamectl.c @@ -689,16 +689,16 @@ static int help(void) { if (r < 0) return log_oom(); - printf("%s [OPTIONS...] COMMAND ...\n\n" - "%sQuery or change system hostname.%s\n" - "\nCommands:\n" + printf("%1$s [OPTIONS...] COMMAND ...\n\n" + "%2$sQuery or change system hostname.%3$s\n" + "\n%4$sCommands:%5$s\n" " status Show current hostname settings\n" " hostname [NAME] Get/set system hostname\n" " icon-name [NAME] Get/set icon name for host\n" " chassis [NAME] Get/set chassis type for host\n" " deployment [NAME] Get/set deployment environment for host\n" " location [NAME] Get/set location for host\n" - "\nOptions:\n" + "\n%4$sOptions:%5$s\n" " -h --help Show this help\n" " --version Show package version\n" " --no-ask-password Do not prompt for password\n" @@ -710,10 +710,12 @@ static int help(void) { " --json=pretty|short|off\n" " Generate JSON output\n" " -j Same as --json=pretty on tty, --json=short otherwise\n" - "\nSee the %s for details.\n", + "\nSee the %6$s for details.\n", program_invocation_short_name, ansi_highlight(), ansi_normal(), + ansi_underline(), + ansi_normal(), link); return 0; -- 2.47.3