]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sysctl: prettify help message
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 5 Oct 2025 17:26:04 +0000 (02:26 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 5 Oct 2025 17:30:28 +0000 (02:30 +0900)
src/sysctl/sysctl.c

index ec622365c913c72651be6e444c6a2ed595a75f9e..3055f796324d550bdd1b21bbf5022460301f996f 100644 (file)
@@ -341,17 +341,22 @@ static int help(void) {
         if (r < 0)
                 return log_oom();
 
-        printf("%s [OPTIONS...] [CONFIGURATION FILE...]\n\n"
-               "Applies kernel sysctl settings.\n\n"
-               "  -h --help             Show this help\n"
-               "     --version          Show package version\n"
+        printf("%1$s [OPTIONS...] [CONFIGURATION FILE...]\n"
+               "\n%2$sApplies kernel sysctl settings.%4$s\n"
+               "\n%3$sCommands:%4$s\n"
                "     --cat-config       Show configuration files\n"
                "     --tldr             Show non-comment parts of configuration\n"
+               "  -h --help             Show this help\n"
+               "     --version          Show package version\n"
+               "\n%3$sOptions:%4$s\n"
                "     --prefix=PATH      Only apply rules with the specified prefix\n"
                "     --no-pager         Do not pipe output into a pager\n"
                "     --strict           Fail on any kind of failures\n"
-               "\nSee the %s for details.\n",
+               "\nSee the %5$s for details.\n",
                program_invocation_short_name,
+               ansi_highlight(),
+               ansi_underline(),
+               ansi_normal(),
                link);
 
         return 0;