aboutsummaryrefslogtreecommitdiff
path: root/module/output/text.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-05-08 22:01:27 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2019-05-08 22:01:27 +0200
commitcef9ad394f015fadfdf620507cf466b5158f63ac (patch)
treea2d0278db5e23401530c63338468a2ed3e391cb0 /module/output/text.scm
parentAdd glob routine. (diff)
downloadcalp-cef9ad394f015fadfdf620507cf466b5158f63ac.tar.gz
calp-cef9ad394f015fadfdf620507cf466b5158f63ac.tar.xz
Add flags for just running the text flower.
It's twisted if one program should do many things, or just a single thing. If we assume that this program does two things: reading calendar files, and writing output, then it should be ok to allow any of those parts to run independentally of the other. Making it ok to just run the text flower.
Diffstat (limited to 'module/output/text.scm')
-rw-r--r--module/output/text.scm10
1 files changed, 10 insertions, 0 deletions
diff --git a/module/output/text.scm b/module/output/text.scm
index 3b83e115..6e67c7b4 100644
--- a/module/output/text.scm
+++ b/module/output/text.scm
@@ -59,3 +59,13 @@
(string-append (string-drop-right trimmed 1)
"…")
trimmed)))
+
+(define-public (open-input-port str)
+ (if (string=? "-" str)
+ (current-input-port)
+ (open-input-file str)))
+
+(define-public (open-output-port str)
+ (if (string=? "-" str)
+ (current-output-port)
+ (open-output-file str)))