summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xbin/tissue21
1 files changed, 14 insertions, 7 deletions
diff --git a/bin/tissue b/bin/tissue
index 789cdb8..28aa68f 100755
--- a/bin/tissue
+++ b/bin/tissue
@@ -66,6 +66,9 @@ exec guile --no-auto-compile -s "$0" "$@"
 (define (invalid-option opt name arg loads)
   (error "Invalid option" name))
 
+(define (unrecognized-argument arg loads)
+  (error "Unrecognized argument" arg))
+
 (define (command-line-program)
   "Return the name, that is arg0, of the command-line program invoked
 to run tissue."
@@ -214,10 +217,11 @@ Export the repository as a website to OUTPUT-DIRECTORY.
 (define tissue-run-web
   (match-lambda*
     (("--help")
-     (format #t "Usage: ~a run-web CONFIG-FILE
+     (format #t "Usage: ~a run-web [OPTIONS]
 Run a web search service reading configuration from CONFIG-FILE.
 
-  --listen-repl=P    run REPL server listening on port or path P
+  --listen-repl=P             run REPL server listening on port or path P
+  -C, --config=CONFIG-FILE    read configuration parameters from CONFIG-FILE
 "
              (command-line-program)))
     (args
@@ -228,12 +232,15 @@ Run a web search service reading configuration from CONFIG-FILE.
                                             (acons 'listen-repl
                                                    (or (string->number arg)
                                                        arg)
-                                                   result))))
+                                                   result)))
+                                  (option '(#\C "config")
+                                          #t #f
+                                          (lambda (opt name config-file result)
+                                            (append (call-with-input-file config-file
+                                                      read)
+                                                    result))))
                             invalid-option
-                            (lambda (config-file result)
-                              (append (call-with-input-file config-file
-                                        read)
-                                      result))
+                            unrecognized-argument
                             ;; Default listen
                             '((listen . "127.0.0.1:8080")))))
        (let ((listen-repl (assq-ref args 'listen-repl)))