- filename=argv[1];
-
- add_include_dir(getcwd(buf, 512));
-
- char*fullfilename = enter_file(filename, 0);
- FILE*fi = fopen(fullfilename, "rb");
- if(!fi) {
- perror(fullfilename);
- return 1;
+ filename=argv[argn-1];
+
+ as3_add_include_dir(getcwd(buf, 512));
+
+ int t=0;
+ for(t=1;t<argn-1;t++) {
+ if(!strcmp(argv[t], "-lex")) {
+ test_lexer(filename);
+ return 0;
+ }
+ if(!strcmp(argv[t], "-v")) {
+ as3_verbosity++;
+ }
+ if(!strcmp(argv[t], "-q")) {
+ as3_verbosity--;
+ }
+ if(!strcmp(argv[t], "-I")) {
+ as3_add_include_dir(argv[++t]);
+ }