]> git.proxmox.com Git - mirror_qemu.git/commit
qemu-img: show help for invalid global options
authorStefan Hajnoczi <stefanha@redhat.com>
Fri, 17 Mar 2017 10:45:39 +0000 (18:45 +0800)
committerMax Reitz <mreitz@redhat.com>
Mon, 27 Mar 2017 14:50:36 +0000 (16:50 +0200)
commit4581c16fce3c1078351f3424208f346b11b378f0
tree0c021c9186f0b319aeebcea3a0b65345908dd6ee
parentea2afcf5b6727a577cf561fd8fe0d8c397ecc927
qemu-img: show help for invalid global options

The qemu-img sub-command executes regardless of invalid global options:

  $ qemu-img --foo info test.img
  qemu-img: unrecognized option '--foo'
  image: test.img
  ...

The unrecognized option warning may be missed by the user.  This can
hide incorrect command-lines in scripts and confuse users.

This patch prints the help information and terminates instead of
executing the sub-command.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20170317104541.28979-2-stefanha@redhat.com
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
qemu-img.c