qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] qemu-img: show help for invalid global options


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH] qemu-img: show help for invalid global options
Date: Fri, 17 Mar 2017 17:45:44 +0800
User-agent: Mutt/1.7.1 (2016-10-04)

On Thu, Mar 16, 2017 at 03:07:29AM +0100, Max Reitz wrote:
> On 13.03.2017 06:11, Stefan Hajnoczi wrote:
> > 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 <address@hidden>
> > ---
> >  qemu-img.c | 1 +
> >  1 file changed, 1 insertion(+)
> 
> Well, now you get blown away by a wall of text and spotting what went
> wrong is actually not quite simple. Maybe we should follow the way of
> the coreutils, that is:
> 
> qemu-img: unrecognized option '--foo'
> Try 'qemu-img --help' for more information.
> 
> ?

Sure, I'll add another patch to improve that.

Stefan

Attachment: signature.asc
Description: PGP signature


reply via email to

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