shared/verbs: turn verb argument specification into nulstr

Like the command-level CommandDescription.argspec, a verb's argspec is now
a nulstr, so that a verb may declare multiple alternative usage lines. The
verbs help table renders one synopsis line per nulstr entry in the
synopsis cell.

All verb argument specifications must gain an explicit NUL suffix. This
is a lot of churn, but I think this needs to be done. For now, there'll
be only one user of the new functionality (i.e. a verb with more than
one argspec), but I think we'll eventually want to use this in other
places too.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2026-08-28 09:29:04 +02:00
parent 057fc4251a
commit efd63ddfbf
42 changed files with 365 additions and 351 deletions
+1 -1
View File
@@ -96,7 +96,7 @@ static const CommandDescription introspect_command = {
static const Verb introspect_verbs[] = {
{ .flags = VERB_COMMAND_MARKER, .data = (uintptr_t) &introspect_command },
{ .verb = "alpha", .min_args = VERB_ANY, .max_args = VERB_ANY, .dispatch = noop_dispatcher,
.argspec = "ARG", .help = "Alpha verb", .option_namespace = "test-verbs-alpha" },
.argspec = "FORM1\0FORM2…\0", .help = "Alpha verb", .option_namespace = "test-verbs-alpha" },
{ .verb = "beta", .min_args = VERB_ANY, .max_args = VERB_ANY, .dispatch = noop_dispatcher,
.help = "Beta verb" },
{}