Skip to content

Commit

Permalink
Add -L --load to gxi (#936)
Browse files Browse the repository at this point in the history
Also fix a typo in multiple places
  • Loading branch information
fare authored Sep 28, 2023
1 parent e816ec3 commit 0d813d3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
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

0 comments on commit 0d813d3

Please sign in to comment.