]> xenbits.xensource.com Git - libvirt.git/commit
virsh: allow alias to expand to opt=value pair
authorEric Blake <eblake@redhat.com>
Thu, 24 Oct 2013 07:06:29 +0000 (08:06 +0100)
committerEric Blake <eblake@redhat.com>
Thu, 24 Oct 2013 10:17:41 +0000 (11:17 +0100)
commit2b172a8effa712aee97a21a64d2d02060958f9b2
tree18179d052be4cff6bf098dc77126df923af3cac9
parent394d6e0a95ac91facba06ab43d67ae8600b14b0e
virsh: allow alias to expand to opt=value pair

We want to treat 'attach-disk --shareable' as an undocumented
alias for 'attach-disk --mode=shareable'.  By improving our
alias handling, we can allow all such --bool -> --opt=value
replacements, and guarantee up front that the alias is not
mixed with its replacement.

* tools/virsh.c (vshCmddefOptParse, vshCmddefGetOption): Add
support for expanding bool alias to --opt=value.
(opts_echo): Add another alias to test it.
* tests/virshtest.c (mymain): Test it.

Signed-off-by: Eric Blake <eblake@redhat.com>
tests/virshtest.c
tools/virsh.c