Merge pull request #205 from KeenS/main-option

add -l option
This commit is contained in:
Yuichi Nishiwaki 2014-09-01 23:57:55 +09:00
commit 40e96e4c2a
1 changed files with 4 additions and 0 deletions

View File

@ -14,6 +14,7 @@
(display "\n") (display "\n")
(display "Options:\n") (display "Options:\n")
(display " -e [program] run one liner script\n") (display " -e [program] run one liner script\n")
(display " -l [file] load the file then enter repl\n")
(display " -h or --help show this help\n")) (display " -h or --help show this help\n"))
(define (getopt) (define (getopt)
@ -26,6 +27,8 @@
(exit 1)) (exit 1))
((-e) ((-e)
(values 'line (cadr args))) (values 'line (cadr args)))
((-l)
(values 'load (cadr args)))
(else (else
(values 'file (car args))))))) (values 'file (car args)))))))
@ -45,6 +48,7 @@
(lambda (type dat) (lambda (type dat)
(case type (case type
((repl) (repl)) ((repl) (repl))
((load) (load dat) (repl))
((line) (exec-line dat)) ((line) (exec-line dat))
((file) (exec-file dat)))))) ((file) (exec-file dat))))))