
-----Original Message----- From: Eric Blake [mailto:eblake@redhat.com] Sent: Thursday, October 24, 2013 3:22 PM To: libvir-list@redhat.com Cc: chenhanxiao@cn.fujitsu.com Subject: [PATCHv2 1/2] 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 | 1 + tools/virsh.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 51 insertions(+), 8 deletions(-)
ACK Thanks!