41 lines
866 B
Scheme
41 lines
866 B
Scheme
(import frontend
|
|
command-line
|
|
texts)
|
|
|
|
(define -port- (make-parameter #f))
|
|
(define -certificate- (make-parameter #f))
|
|
(define -key- (make-parameter #f))
|
|
|
|
(command-line
|
|
print-help
|
|
(-h () "This help"
|
|
(print banner-line)
|
|
(newline)
|
|
(print "Command-line options:")
|
|
(print-help)
|
|
(newline)
|
|
(exit 0))
|
|
(-license () "Show licensing terms"
|
|
(print banner-line)
|
|
(newline)
|
|
(print license)
|
|
(exit 0))
|
|
""
|
|
"Configuration options:"
|
|
(-p (port) "Listen port"
|
|
(-port- (string->number port)))
|
|
(-c (cert) "Certificate"
|
|
(-certificate- cert))
|
|
(-k (key) "Private key"
|
|
(-key- key))
|
|
)
|
|
|
|
(define ssl? (and (-certificate-) (-key-) #t))
|
|
(define port (or (-port-) (if ssl? 443 80)))
|
|
|
|
(print banner-line)
|
|
(print "Port: " port)
|
|
(print "SSL: " ssl?)
|
|
(when ssl?
|
|
(print " Certificate:" (-certificate-))
|
|
(print " Key:" (-key-)))
|