]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
virsh: Enforce proper ordering of options
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 11 Nov 2014 10:01:05 +0000 (11:01 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Thu, 13 Nov 2014 14:44:23 +0000 (15:44 +0100)
commit6beb173df70300df01445f4d64f26e1fb927614d
tree1bba5766947a8cefe7b84b86878ec717ce666bc2
parent11d9dd1ad87d98a8a34132a147271a4e089419e0
virsh: Enforce proper ordering of options

Even though vshCmddefOptParse() tried returning -1 if there was an
optional option specification that preceded a required one, it failed to
check that for boolean type options and options with VSH_OFLAG_REQ_OPT
flag set.  On the other hand, it makes sense that VSH_OT_ARGV is
specified at the end of the option list.

Returning -1 enforces the proper ordering thanks to virsh-synopsis test
in 'make check'.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
tools/virsh.c