summaryrefslogtreecommitdiff
path: root/bin/geiser-racket.sh
blob: 09a92a825ada8e83fc1561f55616bd29124c71cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
#|
top="$(dirname $0)/../scheme"
exec racket -i -S "$top/racket" -l errortrace -cu "$0" ${1+"$@"}
|#

#lang racket/base

(require (lib "cmdline.rkt"))
(require geiser/server)

(define port (make-parameter 0))
(define host (make-parameter #f (lambda (h) (and (string? h) h))))

(command-line
 "run-racket.sh" (current-command-line-arguments)
 (once-each
  (("-n" "--hostname") n "Network hostname, or #f for all interfaces" (host n))
  (("-p" "--port") p "Geiser server port" (port (string->number p)))))

(printf "Geiser server running at port ~a~%" (start-geiser (port) (host)))