mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-06-20 12:56:50 +02:00
command-line shouldn't include interpreter name (fixes issue #484)
This commit is contained in:
parent
f0a8930ab4
commit
06c27d81ce
2 changed files with 3 additions and 5 deletions
|
@ -125,7 +125,7 @@
|
||||||
(let ((args (or (and (pair? o) (car o)) (command-line)))
|
(let ((args (or (and (pair? o) (car o)) (command-line)))
|
||||||
(config (and (pair? o) (pair? (cdr o)) (cadr o))))
|
(config (and (pair? o) (pair? (cdr o)) (cadr o))))
|
||||||
(cond
|
(cond
|
||||||
((parse-app '() (cdr spec) '() (cdr args) config #f #f)
|
((parse-app '() (cdr spec) '() args config #f #f)
|
||||||
=> (lambda (v)
|
=> (lambda (v)
|
||||||
(let ((proc (vector-ref v 0))
|
(let ((proc (vector-ref v 0))
|
||||||
(cfg (vector-ref v 1))
|
(cfg (vector-ref v 1))
|
||||||
|
@ -136,11 +136,11 @@
|
||||||
(let ((res (apply proc cfg spec args)))
|
(let ((res (apply proc cfg spec args)))
|
||||||
(if end (end cfg))
|
(if end (end cfg))
|
||||||
res))))
|
res))))
|
||||||
((null? (cdr args))
|
((null? args)
|
||||||
(app-help spec args)
|
(app-help spec args)
|
||||||
(error "Expected a command"))
|
(error "Expected a command"))
|
||||||
(else
|
(else
|
||||||
(error "Unknown command" (cdr args))))))
|
(error "Unknown command" args)))))
|
||||||
|
|
||||||
;;> Parse a single command-line argument from \var{args} according to
|
;;> Parse a single command-line argument from \var{args} according to
|
||||||
;;> \var{conf-spec}, and returns a list of two values: the
|
;;> \var{conf-spec}, and returns a list of two values: the
|
||||||
|
|
2
main.c
2
main.c
|
@ -543,8 +543,6 @@ sexp run_main (int argc, char **argv) {
|
||||||
if (i < argc)
|
if (i < argc)
|
||||||
for (j=argc-1; j>=i; j--)
|
for (j=argc-1; j>=i; j--)
|
||||||
args = sexp_cons(ctx, tmp=sexp_c_string(ctx,argv[j],-1), args);
|
args = sexp_cons(ctx, tmp=sexp_c_string(ctx,argv[j],-1), args);
|
||||||
if (i >= argc || main_symbol != NULL)
|
|
||||||
args = sexp_cons(ctx, tmp=sexp_c_string(ctx,argv[0],-1), args);
|
|
||||||
load_init(i < argc || main_symbol != NULL);
|
load_init(i < argc || main_symbol != NULL);
|
||||||
sexp_set_parameter(ctx, sexp_meta_env(ctx), sym=sexp_intern(ctx, sexp_argv_symbol, -1), args);
|
sexp_set_parameter(ctx, sexp_meta_env(ctx), sym=sexp_intern(ctx, sexp_argv_symbol, -1), args);
|
||||||
if (i >= argc && main_symbol == NULL) {
|
if (i >= argc && main_symbol == NULL) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue