qemu-img resize: Fix option parsing
authorKevin Wolf <kwolf@redhat.com>
Fri, 29 Apr 2011 08:58:12 +0000 (10:58 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 3 May 2011 09:29:21 +0000 (11:29 +0200)
commit30188682c08481fc54b3dadeb367dc88a1795efc
treef92fca5c17997c30f5f6600ae97d8255a31c277d
parent6f384bc23b8012cc50b7f8745798d56be2748df0
qemu-img resize: Fix option parsing

For shrinking images, you're supposed to use a negative size. However, the
leading minus makes getopt think that it's an option and so you get the help
text if you don't use -- like in 'qemu-img resize test.img -- -1G'.

This patch handles the size first and removes it from the argument list so that
getopt won't even try to interpret it and you don't need -- any more.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-img.c