port num
original commit: 719596d05304d61bb48561a63944cea9fae29713
This commit is contained in:
parent
304cfbf60c
commit
6697e45655
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
(define launch-browser? #t)
|
(define launch-browser? #t)
|
||||||
(define external-connections? #f)
|
(define external-connections? #f)
|
||||||
|
(define port #f)
|
||||||
|
|
||||||
(command-line
|
(command-line
|
||||||
"help-desk"
|
"help-desk"
|
||||||
|
@ -19,9 +20,17 @@
|
||||||
[("-n" "--no-browser") "Do not launch browser"
|
[("-n" "--no-browser") "Do not launch browser"
|
||||||
(set! launch-browser? #f)]
|
(set! launch-browser? #f)]
|
||||||
[("-x" "--external-connections") "Allow external connections"
|
[("-x" "--external-connections") "Allow external connections"
|
||||||
(set! external-connections? #t)]))
|
(set! external-connections? #t)]
|
||||||
|
[("-p" "--port") number "Use given port number"
|
||||||
|
(with-handlers
|
||||||
|
((void (lambda _
|
||||||
|
(error "Help Desk: expected exact integer for port"))))
|
||||||
|
(let ([port-val (string->number number)])
|
||||||
|
(unless (and (integer? port-val) (exact? port-val))
|
||||||
|
(raise 'not-exact-integer))
|
||||||
|
(set! port port-val)))]))
|
||||||
|
|
||||||
(define hd-cookie (start-help-server external-connections?))
|
(define hd-cookie (start-help-server port external-connections?))
|
||||||
(define help-desk-port (hd-cookie->port hd-cookie))
|
(define help-desk-port (hd-cookie->port hd-cookie))
|
||||||
|
|
||||||
(define exit-sem (make-semaphore 0))
|
(define exit-sem (make-semaphore 0))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user