Re: [Qemu-devel] [PATCH] qemu-img: Improve error messages

2014-04-21 Thread Fam Zheng
On Mon, 04/21 09:21, Eric Blake wrote: > On 04/21/2014 12:23 AM, Fam Zheng wrote: > > Previously, when there is an user error in argv parsing, qemu-img prints > > s/an user/a user/ > > (The rule of thumb for selecting which article to use for a leading 'u' > is pronunciation: anything starting wi

Re: [Qemu-devel] [PATCH] qemu-img: Improve error messages

2014-04-21 Thread Eric Blake
On 04/21/2014 12:23 AM, Fam Zheng wrote: > Previously, when there is an user error in argv parsing, qemu-img prints s/an user/a user/ (The rule of thumb for selecting which article to use for a leading 'u' is pronunciation: anything starting with "you" uses "a", anything with "uh" uses "an" [e.g.

[Qemu-devel] [PATCH] qemu-img: Improve error messages

2014-04-20 Thread Fam Zheng
Previously, when there is an user error in argv parsing, qemu-img prints help text and exits. Add an error_exit function to print a helpful error message and a hint to run 'qemu-img --help' for more information. As a bonus, "qemu-img --help" now has a more reasonable exit code 0. In the future