]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
hostnamectl: add usual ansi underlining to --help text 36638/head
authorLennart Poettering <lennart@poettering.net>
Thu, 6 Mar 2025 10:42:11 +0000 (11:42 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 6 Mar 2025 15:26:17 +0000 (16:26 +0100)
src/hostname/hostnamectl.c

index 88f068114ec98d493b3ce90833fc93c4d6cd7f4c..adf3a3296ffb4b8797d9eaef5a5d25458e891dfa 100644 (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;