diff options
| author | Stefan Hajnoczi | 2017-03-17 11:45:41 +0100 |
|---|---|---|
| committer | Max Reitz | 2017-03-27 16:50:36 +0200 |
| commit | c919297379e9980c2bcc4d2053addbc1fd6d762b (patch) | |
| tree | 505147e6b8b95a68b7c10ded61b5e32e5c83e03f /block/commit.c | |
| parent | qemu-img: fix switch indentation in img_amend() (diff) | |
| download | qemu-c919297379e9980c2bcc4d2053addbc1fd6d762b.tar.gz qemu-c919297379e9980c2bcc4d2053addbc1fd6d762b.tar.xz 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 'block/commit.c')
0 files changed, 0 insertions, 0 deletions
