From c23ead8399dbb6da9d5cde35ba99048858e1ed41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Fri, 5 Jun 2020 23:21:25 +0200 Subject: Minor parse fix for -o, + spelling. --- module/main.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'module/main.scm') 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)))) -- cgit v1.2.3