[libvirt] [PATCH] tests: new test: virsh-synopsis

Jim Meyering jim at meyering.net
Fri Nov 21 11:06:30 UTC 2008


"Daniel P. Berrange" <berrange at redhat.com> wrote:
> On Fri, Nov 21, 2008 at 11:13:03AM +0100, Jim Meyering wrote:
>> I wanted help SYNOPSIS output that was regular enough to parse.
>
>>  static const vshCmdInfo info_network_create[] = {
>> -    {"syntax", "create a network from an XML <file>"},
>> +    {"syntax", "net-create <file>"},
>
> I'm kind of wondering why we manually write the "syntax" string at all.
> We know the name of the command, and we know the names of all the
> args, so we can auto-generate this entire string.

Right.  Everything we need is already in e.g., the
associated vshCmdOptDef table.

Any objection to committing that for now?
Once those lines are all generated, the test
won't be needed any more, but in the mean time
it might help.

BTW, I don't see a way to distinguish mutually-exclusive
boolean options (like --all and --inactive, which appear in each
synopsis like [ --inactive | --all ]) from ones that can be
combined like those of attach-disk

    attach-disk <domain> <source> <target> [--driver <driver>] \
      [--subdriver <subdriver>] [--type <type>] [--mode <mode>]

which may be specified independently.
Sure, all of the latter type happen to be non-boolean,
and we could use that,... until we need to add a command
with exclusive non-bool options.




More information about the libvir-list mailing list