Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue 1242 #1243

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/gerbil/gxi-main.ss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
(displayln " -h|--help|help display this help message exit")
(displayln " -v||--version|version display the system version and exit")
(displayln " -L|--load module|file import a module (if begins with :) or load a file")
(displayln " -r|--run module import a module and run its main function with the remaining arguments")
(displayln " -l|--lang module set the current interpretation language; must precede any evaluation")
(displayln " -e|--eval <expr> evaluate an expression")
(displayln)
Expand Down Expand Up @@ -52,6 +53,16 @@
(lp rest))
(else
(error "missing argument for file to load"))))
((member hd '("-r" "--run"))
(match rest
([x . rest]
(let (mod (if (string-prefix? ":" x)
(string->symbol x)
x))
(eval `(import ,mod))
(try-main! rest (lambda (args) (error "cannot run module" x args)))))
(else
(error "missing argument for module to run"))))
((member hd '("-l" "--lang"))
(if can-set-lang?
(match rest
Expand Down
Loading