]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/service-util: actually use the `bus_introspect` argument in `help()` 31721/head
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Mon, 11 Mar 2024 12:56:30 +0000 (13:56 +0100)
committerAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Mon, 11 Mar 2024 12:56:30 +0000 (13:56 +0100)
If `bus_introspect` is false, do not print the `--bus-introspect=PATH` option.

Also, modernize help output.

src/shared/service-util.c

index a415d54084afc40a5d6384fbbb8a2067ae8f7bbe..7d46ee7a66083f5255d6c2d4bb561d3fa8fce0c9 100644 (file)
@@ -17,21 +17,22 @@ static int help(const char *program_path, const char *service, const char *descr
         if (r < 0)
                 return log_oom();
 
-        printf("%s [OPTIONS...]\n\n"
-               "%s%s%s\n\n"
-               "This program takes no positional arguments.\n\n"
-               "%sOptions%s:\n"
+        printf("%1$s [OPTIONS...]\n"
+               "\n%5$s%7$s%6$s\n"
+               "\nThis program takes no positional arguments.\n"
+               "\n%3$sOptions:%4$s\n"
                "  -h --help                 Show this help\n"
                "     --version              Show package version\n"
-               "     --bus-introspect=PATH  Write D-Bus XML introspection data\n"
-               "\nSee the %s for details.\n",
+               "%8$s"
+               "\nSee the %2$s for details.\n",
                program_path,
-               ansi_highlight(),
-               description,
-               ansi_normal(),
+               link,
                ansi_underline(),
                ansi_normal(),
-               link);
+               ansi_highlight(),
+               ansi_normal(),
+               description,
+               bus_introspect ? "     --bus-introspect=PATH  Write D-Bus XML introspection data\n" : "");
 
         return 0; /* No further action */
 }