<p dir="ltr"><br>
On Jul 9, 2014 6:17 PM, "Jason Ekstrand" <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
><br>
><br>
> On Jul 8, 2014 9:18 PM, "Bill Spitzak" <<a href="mailto:spitzak@gmail.com">spitzak@gmail.com</a>> wrote:<br>
> ><br>
> > ---<br>
> > clients/image.c | 5 +++++<br>
> > 1 file changed, 5 insertions(+)<br>
> ><br>
> > diff --git a/clients/image.c b/clients/image.c<br>
> > index 112b93d..573117c 100644<br>
> > --- a/clients/image.c<br>
> > +++ b/clients/image.c<br>
> > @@ -412,6 +412,11 @@ main(int argc, char *argv[])<br>
> > int i;<br>
> > int image_counter = 0;<br>
> ><br>
> > + if (argc <= 1 || argv[1][0]=='-') {<br>
> > + printf("Usage: %s image...\n", argv[0]);<br>
> > + return 1;<br>
> > + }<br>
> > +<br>
><br>
> One little nitpick: Should we really be returning 1 if --help is given? That's not an error.</p>
<p dir="ltr">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.</p>
<p dir="ltr">Perhaps the thing to do in this client is to simply have failing to open the file dump the usage.</p>
<p dir="ltr">><br>
> > d = display_create(&argc, argv);<br>
> > if (d == NULL) {<br>
> > fprintf(stderr, "failed to create display: %m\n");<br>
> > --<br>
> > 1.7.9.5<br>
> ><br>
> > _______________________________________________<br>
> > wayland-devel mailing list<br>
> > <a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
> > <a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</p>