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

Jason Ekstrand jason at jlekstrand.net
Wed Jul 9 18:17:45 PDT 2014


On Jul 8, 2014 9:18 PM, "Bill Spitzak" <spitzak at gmail.com> wrote:
>
> ---
>  clients/image.c |    5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/clients/image.c b/clients/image.c
> index 112b93d..573117c 100644
> --- a/clients/image.c
> +++ b/clients/image.c
> @@ -412,6 +412,11 @@ main(int argc, char *argv[])
>         int i;
>         int image_counter = 0;
>
> +       if (argc <= 1 || argv[1][0]=='-') {
> +               printf("Usage: %s image...\n", argv[0]);
> +               return 1;
> +       }
> +

One little nitpick: Should we really be returning 1 if --help is given?
That's not an error.

>         d = display_create(&argc, argv);
>         if (d == NULL) {
>                 fprintf(stderr, "failed to create display: %m\n");
> --
> 1.7.9.5
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20140709/79b9bc28/attachment.html>


More information about the wayland-devel mailing list