hostnamectl: add usual ansi underlining to --help text

This commit is contained in:
Lennart Poettering
2025-03-06 11:42:11 +01:00
parent bc60034f43
commit f37df1b60e

View File

@@ -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;