]> xenbits.xensource.com Git - libvirt.git/commit
snapshot: tweak snapshot-create-as diskspec docs
authorEric Blake <eblake@redhat.com>
Wed, 14 Sep 2011 21:20:08 +0000 (15:20 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 15 Sep 2011 22:18:12 +0000 (16:18 -0600)
commit85d2810823a31634b12145d6c196930b40425370
treeb3476b19c1bbb2f2bddd136e76029988913c8474
parent9ed46a3ed7d7f26844accac7e5295650ba661e6c
snapshot: tweak snapshot-create-as diskspec docs

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 --diskspec vda --diskspec vdb name desc

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.
* tests/virsh-optparse: Add tests to avoid regressions.
tests/virsh-optparse
tools/virsh.c
tools/virsh.pod