use chicken-specific extensions for less code
til #!key #!optional and #!rest http://wiki.call-cc.org/man/5/Module%20scheme#procedures
This commit is contained in:
parent
f433a6b28a
commit
1209725add
1 changed files with 6 additions and 8 deletions
14
main.scm
14
main.scm
|
@ -31,10 +31,9 @@
|
|||
;; end the program immediately.
|
||||
;; if a message is provided, print it to the screen.
|
||||
;; exit-status defaults to 1.
|
||||
(define (bail . args)
|
||||
(let-optionals args ((msg "") (status 1))
|
||||
(unless (equal? "" msg) (print msg))
|
||||
(exit status)))
|
||||
(define (bail #!optional msg (status 1))
|
||||
(when msg (print msg))
|
||||
(exit status))
|
||||
|
||||
;; decompose a path s into its constituent parts. returns values:
|
||||
;;
|
||||
|
@ -314,15 +313,14 @@
|
|||
(when (file-exists? (make-pathname html-repo-path "ISSUES"))
|
||||
(write-with-template "ISSUES.html" (issueslist->sxml source-files-list)))))
|
||||
|
||||
(define (main args)
|
||||
(let-optionals args ((html-repo-path ""))
|
||||
(define (main #!optional html-repo-path)
|
||||
|
||||
(when (equal? html-repo-path "")
|
||||
(unless html-repo-path
|
||||
(bail "please specify a destination directory for html files"))
|
||||
|
||||
(unless (in-git-directory?)
|
||||
(bail "woops this isn't a git directory"))
|
||||
|
||||
(generate-html-files html-repo-path)))
|
||||
(generate-html-files html-repo-path))
|
||||
|
||||
(main (command-line-arguments))
|
||||
|
|
Loading…
Reference in a new issue