]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
analyze: add section underlining to --help text
authorLennart Poettering <lennart@poettering.net>
Fri, 31 May 2024 10:19:22 +0000 (12:19 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 9 Sep 2024 15:01:19 +0000 (17:01 +0200)
Do this like we usually do these days.

src/analyze/analyze.c

index 150379ca240a51a79aac9abf2ae5fac03b84cb87..8ffacc3d86ee97fb3b35b3d49fa421c53cd31059 100644 (file)
@@ -210,9 +210,9 @@ static int help(int argc, char *argv[], void *userdata) {
         if (r < 0)
                 return log_oom();
 
-        printf("%s [OPTIONS...] COMMAND ...\n\n"
-               "%sProfile systemd, show unit dependencies, check unit files.%s\n"
-               "\nCommands:\n"
+        printf("%1$s [OPTIONS...] COMMAND ...\n\n"
+               "%5$sProfile systemd, show unit dependencies, check unit files.%6$s\n"
+               "\n%3$sCommands:%4$s\n"
                "  [time]                     Print time required to boot the machine\n"
                "  blame                      Print list of running units ordered by\n"
                "                             time to init\n"
@@ -220,7 +220,7 @@ static int help(int argc, char *argv[], void *userdata) {
                "                             of units\n"
                "  plot                       Output SVG graphic showing service\n"
                "                             initialization\n"
-               "  dot [UNIT...]              Output dependency graph in %s format\n"
+               "  dot [UNIT...]              Output dependency graph in %7$s format\n"
                "  dump [PATTERN...]          Output state serialization of service\n"
                "                             manager\n"
                "  cat-config NAME|PATH...    Show configuration file and drop-ins\n"
@@ -247,7 +247,7 @@ static int help(int argc, char *argv[], void *userdata) {
                "  pcrs [PCR...]              Show TPM2 PCRs and their names\n"
                "  srk [>FILE]                Write TPM2 SRK (to FILE)\n"
                "  smbios11                   List strings passed via SMBIOS Type #11\n"
-               "\nOptions:\n"
+               "\n%3$sOptions:%4$s\n"
                "     --recursive-errors=MODE Control which units are verified\n"
                "     --offline=BOOL          Perform a security review on unit file(s)\n"
                "     --threshold=N           Exit with a non-zero status when overall\n"
@@ -291,12 +291,14 @@ static int help(int argc, char *argv[], void *userdata) {
                "     --root=PATH             Operate on an alternate filesystem root\n"
                "     --image=PATH            Operate on disk image as filesystem root\n"
                "     --image-policy=POLICY   Specify disk image dissection policy\n"
-               "\nSee the %s for details.\n",
+               "\nSee the %2$s for details.\n",
                program_invocation_short_name,
+               link,
+               ansi_underline(),
+               ansi_normal(),
                ansi_highlight(),
                ansi_normal(),
-               dot_link,
-               link);
+               dot_link);
 
         /* When updating this list, including descriptions, apply changes to
          * shell-completion/bash/systemd-analyze and shell-completion/zsh/_systemd-analyze too. */