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

Add -L --load to gxi #936

Merged
merged 3 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
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
12 changes: 11 additions & 1 deletion src/gerbil/gxi-main.ss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
(displayln "Options: ")
(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 " -l|--lang module set the current interpretation language; must precede any evaluation")
(displayln " -e|--eval <expr> evaluate an expression")
(displayln)
Expand Down Expand Up @@ -40,6 +41,15 @@
(gxi-print-usage!))
((member hd '("-v" "--version"))
(displayln (gerbil-system-version-string)))
((member hd '("-L" "--load"))
(match rest
([x . rest]
(if (string-prefix? ":" x)
(eval `(import ,(string->symbol x)))
(load x))
(lp rest))
(else
(error "missing argument for file to load"))))
((member hd '("-l" "--lang"))
(if can-set-lang?
(match rest
Expand Down Expand Up @@ -75,7 +85,7 @@
(enter-repl!)
(lp rest))))
((string-prefix? "-" hd)
(error "uknown option; try -h or --help for options" hd))
(error "unknown option; try -h or --help for options" hd))
((string-prefix? ":" hd)
(set! can-set-lang? #f)
(set! end-interactive? #f)
Expand Down
2 changes: 1 addition & 1 deletion src/std/actor-v13/rpc/connection.ss
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@
(begin
(warnf "unexpected control message; unknown stream ~a" cont)
(unless (!abort? content)
(dispatch-remote-error (make-!error "uknown stream" cont) (message-dest msg)))))))
(dispatch-remote-error (make-!error "unknown stream" cont) (message-dest msg)))))))

(def (value-k obj)
(##vector-ref obj (fx1- (##vector-length obj))))
Expand Down
2 changes: 1 addition & 1 deletion src/tools/gxpkg.ss
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@
((values pkg tag) (pkg+tag pkg))
(dest (path-expand pkg root)))
(unless (file-exists? dest)
(error "Cannot update uknown package" pkg))
(error "Cannot update unknown package" pkg))
(and (not (file-symbolic-link? dest))
(pkg-fetch-git pkg tag))))

Expand Down