diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-06-05 23:21:25 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-06-05 23:21:25 +0200 |
commit | c23ead8399dbb6da9d5cde35ba99048858e1ed41 (patch) | |
tree | ffc4bb3770412a51061c77de6741c6aa46ecf5b3 /module/main.scm | |
parent | Change top error handler. (diff) | |
download | calp-c23ead8399dbb6da9d5cde35ba99048858e1ed41.tar.gz calp-c23ead8399dbb6da9d5cde35ba99048858e1ed41.tar.xz |
Minor parse fix for -o, + spelling.
Diffstat (limited to '')
-rw-r--r-- | module/main.scm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/module/main.scm b/module/main.scm index 31d6957c..287bc75e 100644 --- a/module/main.scm +++ b/module/main.scm @@ -51,6 +51,8 @@ (br) (b "Should NOT be used in production."))) + ;; TODO --config flag for loading alternate configuration file. + ;; Techical note: ;; Guile's getopt doesn't support repeating keys. Thereby the small jank, ;; and my regex hack below. @@ -122,10 +124,13 @@ (map (lambda (pair) (let* (((key value) (string-split (cadr pair) #\=))) (set-config! (string->symbol key) - (primitive-eval (call-with-input-string value read))))) + (let ((form (call-with-input-string value read))) + (if (list? form) + (primitive-eval form) + form))))) (filter (lambda (p) ;; should match `--option', as well as a single flag with any - ;; number of othter options, as long as the last one is `o'. + ;; number of other options, as long as the last one is `o'. (string-match "^-(-option|[^-]*o)$" (car p))) (zip args (cdr args)))) |