Kenneth Graunke <kenn...@whitecape.org> writes:
> How about:
>
>       if (optind == argc - 1) {
>               filename = argv[optind];
>       } else if (optind < argc) {
>               usage ();
>               exit (1);
>       }

Thanks, that does catch an additional usage error that was let through
previously. I've updated this to also emit a detailed error about the
message, (and re-ordered the conditions). Here's what I'll plan to push:

        if (optind + 1 < argc) {
                printf ("Unexpected argument: %s\n", argv[optind+1]);
                usage ();
                exit (1);
        }
        if (optind < argc) {
                filename = argv[optind];
        }

-Carl

-- 
carl.d.wo...@intel.com

Attachment: pgpVcdneJ7X_s.pgp
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to