aboutsummaryrefslogtreecommitdiff
path: root/module/calp/entry-points/text.scm
diff options
context:
space:
mode:
Diffstat (limited to 'module/calp/entry-points/text.scm')
-rw-r--r--module/calp/entry-points/text.scm15
1 files changed, 10 insertions, 5 deletions
diff --git a/module/calp/entry-points/text.scm b/module/calp/entry-points/text.scm
index 0a5744b3..921afb80 100644
--- a/module/calp/entry-points/text.scm
+++ b/module/calp/entry-points/text.scm
@@ -4,16 +4,18 @@
:use-module (ice-9 getopt-long)
:use-module (hnh util io)
:use-module (hnh util options)
+ :use-module (calp translation)
+ :use-module (sxml simple)
)
(define options
- '((width (value #t) (single-char #\w)
- (description "Width of written text, defaults to 70 chars."))
+ `((width (value #t) (single-char #\w)
+ (description ,(_ "Width of written text, defaults to 70 chars.")))
(file (value #t) (single-char #\f)
- (description "Read from " (i "file") " instead of standard input."))
+ (description ,(xml->sxml (_ "<group>Read from <i>file</i> instead of standard input.</group>"))))
(help (single-char #\h)
- (description "Prints this help."))))
+ (description ,(_ "Prints this help.")))))
(define (main args)
(define opts (getopt-long args (getopt-opt options)))
@@ -24,6 +26,9 @@
(for-each (lambda (l) (display l) (newline))
(flow-text
- (with-input-from-port (open-input-port (option-ref opts 'file "-"))
+ (with-input-from-port (let ((fname (option-ref opts 'file "-")))
+ (if (string=? fname "-")
+ (current-input-port)
+ (open-input-file fname)))
(@ (ice-9 rdelim) read-string))
#:width (or (string->number (option-ref opts 'width "")) 70))))