]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/verbs: when showing default verb, put [] around the args too
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Thu, 7 May 2026 11:38:04 +0000 (13:38 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Thu, 7 May 2026 16:39:04 +0000 (18:39 +0200)
The verb cannot be omitted but the args kept, so:
  resolvectl [status] [link]
is wrong, we need:
  resolvectl [status [link]]

Fixes f94da4b4c564f8cff4b5b739456c985e036a4201.

src/shared/verbs.c

index 276c6fd5be91623e576db146f11b5cfd4f8844b4..274945e5c5977563e28266664a25955690b0946c 100644 (file)
@@ -200,9 +200,9 @@ int _verbs_get_help_table(
                 r = table_add_cell_stringf(table, NULL, "  %s%s%s%s%s",
                                            is_default ? "[" : "",
                                            verb->verb,
-                                           is_default ? "]" : "",
                                            verb->argspec ? " " : "",
-                                           strempty(verb->argspec));
+                                           strempty(verb->argspec),
+                                           is_default ? "]" : "");
                 if (r < 0)
                         return table_log_add_error(r);