diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-08-17 17:52:01 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-08-17 17:52:01 +0200 |
commit | 6a219c59e6506ee5326822a7ced0e6cd92b7b628 (patch) | |
tree | 3cf44cef098fb0a98137abd7942d8aa10592ddfc /module/calp/entry-points/terminal.scm | |
parent | stuff. (diff) | |
download | calp-6a219c59e6506ee5326822a7ced0e6cd92b7b628.tar.gz calp-6a219c59e6506ee5326822a7ced0e6cd92b7b628.tar.xz |
Move a bunch of files into calp module.
Diffstat (limited to 'module/calp/entry-points/terminal.scm')
-rw-r--r-- | module/calp/entry-points/terminal.scm | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/module/calp/entry-points/terminal.scm b/module/calp/entry-points/terminal.scm new file mode 100644 index 00000000..5a9b2588 --- /dev/null +++ b/module/calp/entry-points/terminal.scm @@ -0,0 +1,28 @@ +(define-module (calp entry-points terminal) + :export (main) + :use-module (output terminal) + :use-module (vcomponent) + :use-module (ice-9 getopt-long) + :use-module (datetime) + :use-module (vulgar) + :use-module (util options) + ) + +(define options + '((date (value #t) (single-char #\d) + (description "Which date to start on.")) + (help (single-char #\t) (description "Print this help.")) + )) + +(define (main args) + (define opts (getopt-long args (getopt-opt options))) + + (when (option-ref opts 'help #f) + (print-arg-help options) + (throw 'return)) + + (let ((date (or (and=> (option-ref opts 'date #f) parse-freeform-date) + (current-date)))) + (with-vulgar + (lambda () (main-loop date)))) +) |