6 int parse_args(int argc, char **argv);
11 int main(int argc, char **argv)
13 if(parse_args(argc, argv) == -1) {
17 if(!(gscn = goat3d_create()) || goat3d_load(gscn, opt_fname) == -1) {
25 int parse_args(int argc, char **argv)
27 static const char *usage_fmt = "Usage: %s [options] <goat3d scene file>\n"
29 " -h: print usage and exit\n\n";
32 for(i=1; i<argc; i++) {
33 if(argv[i][0] == '-') {
35 fprintf(stderr, "invalid option: %s\n", argv[i]);
40 printf(usage_fmt, argv[0]);
44 fprintf(stderr, "invalid option: %s\n", argv[i]);
49 fprintf(stderr, "unexpected argument: %s\n", argv[i]);
57 fprintf(stderr, "pass a goat3d scene file to process\n");