(import scheme (chicken base) manual-labor) (import (chicken port) (chicken process-context) (chicken format)) (import matchable) (define (usage . msg) (with-output-to-port (current-error-port) (lambda () (unless (null? msg) (apply print msg)) (printf " usage: ~a [options] mandir htmldir options: --support DIR Look in DIR for support files (CSS, JS, etc.) (default: ~s) --help Display this usage information Generate an HTML manual from the wiki manual files in MANDIR. Output files are placed in HTMLDIR. " (program-name) (manual-labor-support-dir)) (exit 1)))) (define (parse-args) (let loop ((args (command-line-arguments))) (cond ((null? args) args) ((string=? "--support" (car args)) (manual-labor-support-dir (cadr args)) (loop (cddr args))) ((string=? "--help" (car args)) (usage)) (else args)))) (match (parse-args) ((indir outdir) (generate-html-manual indir outdir)) (else (usage)))