In MAIN: get directory from args parameter, not command-line;

allows to start main from within scsh manually
Add comments how to use rman-handler and info-handler
This commit is contained in:
interp 2004-05-12 19:43:13 +00:00
parent 7a04cf81d5
commit 246c2b46ad
1 changed files with 5 additions and 2 deletions

View File

@ -119,8 +119,8 @@ exec scsh -lel SSAX-4.9/load.scm -lel sunet-2.1/load.scm -dm -o http-test -e mai
(error "Internal error, option not found" option alist))))
(define (main args)
(with-cwd
(file-name-directory (car (command-line)))
(with-cwd "."
(file-name-directory (car args))
(let ((options (make-options-from-args (cdr args))))
(cond ((zero? (user-uid))
(set-gid (->gid "nobody"))
@ -151,12 +151,15 @@ exec scsh -lel SSAX-4.9/load.scm -lel sunet-2.1/load.scm -dm -o http-test -e mai
(list (cons "h" (home-dir-handler "public_html"))
(cons "seval" seval-handler)
;; You may want to adapt this to your site.
;; call like http://localhost:8080/man/man?ssh(1)
(cons "man" (rman-handler 'man
'nroff
"/usr/bin/rman"
"/usr/bin/zcat"
#f "man?%s(%s)"
"Generated by rman-gateway"))
;; call like http://localhost:8080/info/info?(slib.info)Top
;; note: can only handle not-gzipped info files
(cons "info" (info-handler #f #f #f
"Generated by info-gateway"))
(cons "cgi-bin" (cgi-handler