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:
@@ -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" },
|
||||
{}
|
||||
|
||||
Reference in New Issue
Block a user