On Wed, Sep 14, 2011 at 15:27:32 -0600, Eric Blake wrote: > With this patch, it is hopefully a bit more obvious that for > snapshot-create-as, a literal '--diskspec' is mandatory if name > or description was omitted, but optional if all earlier options > were provided. > > These all denote two diskspecs and a description: > virsh snapshot-create-as dom name desc vda vdb > virsh snapshot-create-as dom name desc --diskspec vda --diskspec vdb > virsh snapshot-create-as dom name desc --diskspec vda vdb > virsh snapshot-create-as dom name desc vda --diskspec vdb > virsh snapshot-create-as dom name desc --diskspec vda --diskspec vdb > > This gives two diskspecs but no description: > virsh snapshot-create-as dom name --diskspec vda --diskspec vdb > > And this treats 'vda' as the description, with only one diskspec: > virsh snapshot-create-as dom name vda vdb > > The help output now shows: > snapshot-create-as <domain> [<name>] [<description>] [--print-xml] [--no-metadata] [--halt] [--disk-only] [[--diskspec] <string>]... > > I also checked the help output for echo and send-key, which are two > other variants of argv commands. > > * tools/virsh.pod (snapshot-create-as): Document when a literal > --diskspec must preceed a diskspec argument. > * tools/virsh.c (vshCmddefHelp): Update help output for argv when > naming the option is useful. > (vshCmddefGetData): Fix logic on when argv was seen. > Reported by Nan Zhang. > --- > > I think this is more comprehensive than Nan's patch, for nicer results. > > tools/virsh.c | 27 +++++++++++++++++++++------ > tools/virsh.pod | 6 ++++-- > 2 files changed, 25 insertions(+), 8 deletions(-) Option parsing in virsh is... oh well, ACK :) Jirka -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list