summaryrefslogtreecommitdiff
path: root/scripts/mumi.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mumi.in')
-rw-r--r--scripts/mumi.in27
1 files changed, 15 insertions, 12 deletions
diff --git a/scripts/mumi.in b/scripts/mumi.in
index 9c997a2..755dfb3 100644
--- a/scripts/mumi.in
+++ b/scripts/mumi.in
@@ -85,12 +85,8 @@
(error "invalid web server port" arg)))))
(option '("listen-repl") #f #t
(lambda (opt name arg result)
- (let ((port (cond (arg => string->number)
- (else %default-repl-server-port))))
- (if port
- (alist-cons 'listen-repl port
- (alist-delete 'listen-repl result))
- (error "invalid REPL server port" arg)))))
+ (alist-cons 'listen-repl (or (string->number arg) arg)
+ (alist-delete 'listen-repl result))))
(option '("disable-mailer") #f #f
(lambda (opt name arg result)
(alist-cons 'disable-mailer #t result)))
@@ -150,12 +146,19 @@
(("web" . rest)
(let ((opts (parse-options rest)))
(parameterize ((mailer-enabled? (not (assoc-ref opts 'disable-mailer))))
- (let ((repl-port (assoc-ref opts 'listen-repl)))
- (when repl-port
- (format (current-error-port)
- "REPL server listening on port ~a~%"
- repl-port)
- (spawn-server (make-tcp-server-socket #:port repl-port))))
+ (let ((listen-repl (assoc-ref opts 'listen-repl)))
+ (when listen-repl
+ (cond
+ ((number? listen-repl)
+ (format (current-error-port)
+ "REPL server listening on port ~a~%"
+ listen-repl)
+ (spawn-server (make-tcp-server-socket #:port listen-repl)))
+ (else
+ (format (current-error-port)
+ "REPL server listening on ~a~%"
+ listen-repl)
+ (spawn-server (make-unix-domain-server-socket #:path listen-repl))))))
(start-mumi-web-server (or (assoc-ref opts 'address)
"0.0.0.0")
(or (assoc-ref opts 'port)