From 6697e45655c77ebad397af7fce3fa3c0bc77fb83 Mon Sep 17 00:00:00 2001 From: Paul Steckler Date: Thu, 11 Jul 2002 21:07:14 +0000 Subject: [PATCH] port num original commit: 719596d05304d61bb48561a63944cea9fae29713 --- collects/help/help.ss | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/collects/help/help.ss b/collects/help/help.ss index 9bc99f04..c21149eb 100644 --- a/collects/help/help.ss +++ b/collects/help/help.ss @@ -11,6 +11,7 @@ (define launch-browser? #t) (define external-connections? #f) + (define port #f) (command-line "help-desk" @@ -19,9 +20,17 @@ [("-n" "--no-browser") "Do not launch browser" (set! launch-browser? #f)] [("-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 exit-sem (make-semaphore 0))