qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 3/3] qemu-img: print short help on getopt fai


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v2 3/3] qemu-img: print short help on getopt failure
Date: Sat, 18 Mar 2017 03:56:27 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1

On 17.03.2017 11:45, Stefan Hajnoczi wrote:
> 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 <address@hidden>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> ---
>  qemu-img.c | 117 
> ++++++++++++++++++++++++++++++++++++++++++++++++++-----------
>  1 file changed, 97 insertions(+), 20 deletions(-)

Uh, right, this was pretty much pre-existing. Then even more so thanks
for this patch. :-)

Reviewed-by: Max Reitz <address@hidden>

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]