]> xenbits.xensource.com Git - libvirt.git/commit
virsh: rework command parsing
authorLai Jiangshan <laijs@cn.fujitsu.com>
Tue, 12 Oct 2010 07:14:01 +0000 (15:14 +0800)
committerEric Blake <eblake@redhat.com>
Wed, 13 Oct 2010 13:52:32 +0000 (07:52 -0600)
commita2943243c4cfb677dc3443013bf9da37c8768bf3
tree0632dcf522ab1eca4b3a1e7db8a4c13a5abd2806
parenta93f514f5f7025526aee5f3a72e997b7d258be4e
virsh: rework command parsing

Old virsh command parsing mashes all the args back into a string and
miss the quotes, this patches fix it. It is also needed for introducing
qemu-monitor-command which is very useful.

This patches uses the new vshCommandParser abstraction and adds
vshCommandArgvParse() for arguments vector, so we don't need
to mash arguments vector into a command sting.

And the usage was changed:
old:
virsh [options] [commands]

new:
virsh [options]... [<command_string>]
virsh [options]... <command> [args...]

So we still support commands like:
"define D.xml; dumpxml D" was parsed as a commands-string.

and support commands like:
we will not mash them into a string, we use new argv parser for it.

But we don't support the command like:
"define D.xml; dumpxml" was parsed as a command-name, but we have no such command-name.

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