blob: 09ae80042add5dadb29d928ca11ab0ae104d1258 (
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
|
(define-module (entry-points terminal)
:export (main)
:use-module (output terminal)
:use-module (vcomponent)
:use-module (ice-9 getopt-long)
:use-module (datetime)
:use-module (datetime util)
:use-module (parameters)
:use-module (vulgar)
)
(define options
'((date (value #t) (single-char #\d))
(file (value #t) (single-char #\f))))
(define (main args)
(define opts (getopt-long args options))
(define-values (calendars events)
(load-calendars
calendar-files: (cond [(option-ref opts 'file #f) => list]
[else (calendar-files)]) ))
(let ((date (or (and=> (option-ref opts 'date #f) parse-freeform-date)
(current-date))))
;; (format (current-error-port) "len(events) = ~a~%" (stream-length events))
(with-vulgar
(lambda () (main-loop date events))))
)
|