summaryrefslogtreecommitdiff
path: root/tools/skribebibtex/bigloo/main.scm
blob: 3ff89de08599896fdcb0475568521563e39e6104 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
;*=====================================================================*/
;*    serrano/prgm/project/skribe/tools/skribebibtex/main.scm          */
;*    -------------------------------------------------------------    */
;*    Author      :  Manuel Serrano                                    */
;*    Creation    :  Fri Oct 12 14:57:58 2001                          */
;*    Last change :  Fri Oct 24 12:00:23 2003 (serrano)                */
;*    Copyright   :  2001-03 Manuel Serrano                            */
;*    -------------------------------------------------------------    */
;*    The entry point of the bibtex->skribe translator                 */
;*=====================================================================*/

;*---------------------------------------------------------------------*/
;*    The module                                                       */
;*---------------------------------------------------------------------*/
(module main
   (import skribebibtex)
   (main main))

;*---------------------------------------------------------------------*/
;*    main ...                                                         */
;*---------------------------------------------------------------------*/
(define (main argv)
   (define (usage args-parse-usage)
      (print "usage: skribebibtex [options] [input]")
      (newline)
      (args-parse-usage #f))
   (let ((stage 'scr)
	 (dest #f)
	 (in #f))
      (args-parse (cdr argv)
	 ((("-h" "--help") (help "This help message"))
	  (usage args-parse-usage)
	  (exit 0))
	 ((("--options") (help "Display the options and exit"))
	  (args-parse-usage #t)
	  (exit 0))
	 (("-o" ?out (help "Set the destination file"))
	  (set! dest out))
	 (else
	  (set! in else)))
      (if (string? dest)
	  (with-output-to-file dest (lambda () (skribebibtex in)))
	  (skribebibtex in))))