summary refs log tree commit diff stats
path: root/hw/core/qdev-properties-system.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2017-03-17 18:45:41 +0800
committerMax Reitz <mreitz@redhat.com>2017-03-27 16:50:36 +0200
commitc919297379e9980c2bcc4d2053addbc1fd6d762b (patch)
tree505147e6b8b95a68b7c10ded61b5e32e5c83e03f /hw/core/qdev-properties-system.c
parentf7077624b036bd70b0b04d6b3f9a7effc80a74a9 (diff)
downloadfocaccia-qemu-c919297379e9980c2bcc4d2053addbc1fd6d762b.tar.gz
focaccia-qemu-c919297379e9980c2bcc4d2053addbc1fd6d762b.zip
qemu-img: print short help on getopt failure
Printing the full help output obscures the error message for an invalid
command-line option or missing argument.

Before this patch:

  $ ./qemu-img --foo
  ...pages of output...

After this patch:

  $ ./qemu-img --foo
  qemu-img: unrecognized option '--foo'
  Try 'qemu-img --help' for more information

This patch adds the getopt ':' character so that it can distinguish
between missing arguments and unrecognized options.  This helps provide
more detailed error messages.

Suggested-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20170317104541.28979-4-stefanha@redhat.com
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'hw/core/qdev-properties-system.c')
0 files changed, 0 insertions, 0 deletions