From cef9ad394f015fadfdf620507cf466b5158f63ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 8 May 2019 22:01:27 +0200 Subject: 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. --- module/output/text.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'module/output/text.scm') 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))) -- cgit v1.2.3