]> xenbits.xensource.com Git - libvirt.git/commit
virsh: better handling the boolean option
authorLai Jiangshan <laijs@cn.fujitsu.com>
Tue, 12 Oct 2010 07:13:39 +0000 (15:13 +0800)
committerEric Blake <eblake@redhat.com>
Wed, 13 Oct 2010 13:52:32 +0000 (07:52 -0600)
commit4417f08de46e166f94b5db148b6ff4e3d65922e5
tree37028c6405d34093ac531de502fe15870cd91e5f
parentcdfe543fc8cbdf82b4656126a4b69953d1864fdd
virsh: better handling the boolean option

in old code the following commands are equivalent:
     virsh # dumpxml --update-cpu=vm1
     virsh # dumpxml --update-cpu vm1
because the old code split the option argument into 2 parts:
--update-cpu=vm1 is split into update-cpu and vm1,
and update-cpu is a boolean option, so the parser takes vm1 as another
argument, very strange.

after this patch applied, the first one will become illegal.

To achieve this, we don't parse/check options when parsing command sting,
but check options when parsing a command argument. And the argument is
not split when parsing command sting.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
tools/virsh.c