aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-05-04 18:30:04 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-05-04 18:30:04 +0200
commitea29b985530a94daa18250ab4532d0690992f597 (patch)
tree67580aa650f54105e770aa514e922be399b12694
parentRemove 'info' entry point. (diff)
downloadcalp-ea29b985530a94daa18250ab4532d0690992f597.tar.gz
calp-ea29b985530a94daa18250ab4532d0690992f597.tar.xz
Add --help to ical.
-rw-r--r--module/entry-points/ical.scm14
1 files changed, 11 insertions, 3 deletions
diff --git a/module/entry-points/ical.scm b/module/entry-points/ical.scm
index dc060ec6..7e780d89 100644
--- a/module/entry-points/ical.scm
+++ b/module/entry-points/ical.scm
@@ -1,6 +1,7 @@
(define-module (entry-points ical)
:export (main)
:use-module (util)
+ :use-module (util options)
:use-module (output ical)
:use-module ((vcomponent) :select (load-calendars*))
:use-module (ice-9 getopt-long)
@@ -10,11 +11,13 @@
(define opt-spec
'((from (value #t) (single-char #\F))
- (to (value #t) (single-char #\T))
- (file (value #t) (single-char #\f))))
+ (to (value #t) (single-char #\T)
+ (description "Returns all elements between these two dates."))
+ (help (single-char #\h)
+ (description "Print this help."))))
(define (main args)
- (define opts (getopt-long args opt-spec))
+ (define opts (getopt-long args (getopt-opt opt-spec)))
(define start (cond [(option-ref opts 'from #f) => parse-freeform-date]
[else (start-of-month (current-date))]))
@@ -22,4 +25,9 @@
;; [else (normalize-date* (set (month start) = (+ 1)))]
[(date+ start (date month: 1))]
))
+
+ (when (option-ref opts 'help #f)
+ (print-arg-help opt-spec)
+ (throw 'return))
+
(ical-main start end))