Kenneth Graunke <[email protected]> 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
--
[email protected]
pgpVcdneJ7X_s.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
