Skip to content

Commit

Permalink
command-line shouldn't include interpreter name (fixes issue #484)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashinn committed Dec 10, 2018
1 parent f0a8930 commit 06c27d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/chibi/app.scm
Expand Up @@ -125,7 +125,7 @@
(let ((args (or (and (pair? o) (car o)) (command-line)))
(config (and (pair? o) (pair? (cdr o)) (cadr o))))
(cond
((parse-app '() (cdr spec) '() (cdr args) config #f #f)
((parse-app '() (cdr spec) '() args config #f #f)
=> (lambda (v)
(let ((proc (vector-ref v 0))
(cfg (vector-ref v 1))
Expand All @@ -136,11 +136,11 @@
(let ((res (apply proc cfg spec args)))
(if end (end cfg))
res))))
((null? (cdr args))
((null? args)
(app-help spec args)
(error "Expected a command"))
(else
(error "Unknown command" (cdr args))))))
(error "Unknown command" args)))))

;;> Parse a single command-line argument from \var{args} according to
;;> \var{conf-spec}, and returns a list of two values: the
Expand Down
2 changes: 0 additions & 2 deletions main.c
Expand Up @@ -543,8 +543,6 @@ sexp run_main (int argc, char **argv) {
if (i < argc)
for (j=argc-1; j>=i; j--)
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);
sexp_set_parameter(ctx, sexp_meta_env(ctx), sym=sexp_intern(ctx, sexp_argv_symbol, -1), args);
if (i >= argc && main_symbol == NULL) {
Expand Down

0 comments on commit 06c27d8

Please sign in to comment.