[PATCH 10/11] weston-image --help works. Also help if no filename is given

Bill Spitzak spitzak at gmail.com
Wed Jul 16 12:41:39 PDT 2014


On 07/09/2014 06:32 PM, Jason Ekstrand wrote:

>  > One little nitpick: Should we really be returning 1 if --help is
> given?  That's not an error.
>
> On second thought, I ran a bunch of little utilities and things and some
> of them always given an error with the usage and others don't.  However,
> if we're going to claim to have a --help or -h option, we shouldn't
> error on it.  Considering it to be malformed input and printing an error
> message is fine.

Yea, these patches were mainly concerned with getting all the programs 
to not run and produce usage information if there is anything wrong with 
the argument line. In most cases -h "works" to print the help because it 
is not recognized, so the return value is the same. I was most concerned 
with making these demos a little less annoying for somebody unfamiliar 
with them, not sure if it is worth it to complicate them to make them 
return different values depending on whether -h is passed or not.

In addition, unix command-line utilities are pretty inconsistent about 
whether they return success or failure when they print usage 
information. Some succeed all the time, some fail all the time.

> Perhaps the thing to do in this client is to simply have failing to open
> the file dump the usage.

That should print an error describing why it can't open the file. I will 
post a patch that fixes that.




More information about the wayland-devel mailing list