diff --git a/scheme/ikarus.main.ss b/scheme/ikarus.main.ss index 3ae5454..7ecb58f 100644 --- a/scheme/ikarus.main.ss +++ b/scheme/ikarus.main.ss @@ -115,12 +115,19 @@ [else (let-values ([(f* script script-type a*) (f (cdr args))]) (values (cons (car args) f*) script script-type a*))]))]) + (define (assert-null files who) + (unless (null? files) + (apply die 'ikarus + (format "load files not allowed for ~a" who) + files))) (cond [(eq? script-type 'r6rs-script) + (assert-null files "--r6rs-script") (command-line-arguments (cons script args)) (load-r6rs-top-level script 'run) (exit 0)] [(eq? script-type 'compile) + (assert-null files "--compile-dependencies") (command-line-arguments (cons script args)) (load-r6rs-top-level script 'compile) (exit 0)] diff --git a/scheme/last-revision b/scheme/last-revision index 184de29..d0e5260 100644 --- a/scheme/last-revision +++ b/scheme/last-revision @@ -1 +1 @@ -1635 +1636 diff --git a/src/ikarus.c b/src/ikarus.c index e99a42b..ebefd0c 100644 --- a/src/ikarus.c +++ b/src/ikarus.c @@ -53,70 +53,21 @@ Options for running ikarus scheme:\n\ fprintf(stderr, helpstring, BOOTFILE); } - -/* get_option - - takes pointers to argc and argv and looks for the first - option matching opt. If one exists, it removes it from the argv - list, updates argc, and returns a pointer to the option value. - returns null if option is not found. - */ -char* -get_option(char* opt, int argc, char** argv){ - int i; - for(i=1; i= 2) && (strcmp(argv[1], "-h") == 0)) || + ((argc == 2) && (strcmp(argv[1], "-b") == 0))) { ikarus_usage(); exit(0); } - char* boot_file = get_option("-b", argc, argv); - if(boot_file){ + + if ((argc >= 3) && (strcmp(argv[1], "-b") == 0)){ + boot_file = argv[2]; + int i; + for(i=3; i<=argc; i++){ + argv[i-2] = argv[i]; + } argc -= 2; - } else { - boot_file = BOOTFILE; } return ikarus_main(argc, argv, boot_file); } diff --git a/src/scheme-script.c b/src/scheme-script.c index c1dde8e..87f33f8 100644 --- a/src/scheme-script.c +++ b/src/scheme-script.c @@ -49,7 +49,6 @@ int main(int argc, char** argv){ char** args = calloc(sizeof(char*), argc+1); args[0] = argv[0]; args[1] = "--r6rs-script"; - args[2] = argv[1]; int i; for(i=1; i