From c369d0993df8b907291d056ea743aab2ac0511c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 4 May 2020 17:36:41 +0200 Subject: text main should now read it's arguments. --- module/entry-points/text.scm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/module/entry-points/text.scm b/module/entry-points/text.scm index a537b6ac..69bb1691 100644 --- a/module/entry-points/text.scm +++ b/module/entry-points/text.scm @@ -11,9 +11,11 @@ (file (value #t) (single-char #\f)) )) -(define (main opts) - (for-each (lambda (l) (display l) (newline)) - (flow-text - (with-input-from-port (open-input-port (option-ref opts 'file "-")) - (@ (ice-9 rdelim) read-string)) - #:width (or (string->number (option-ref opts 'width "")) 70)))) +(define (main args) + (define opts (getopt-long args options)) + + (for-each (lambda (l) (display l) (newline)) + (flow-text + (with-input-from-port (open-input-port (option-ref opts 'file "-")) + (@ (ice-9 rdelim) read-string)) + #:width (or (string->number (option-ref opts 'width "")) 70)))) -- cgit v1.2.3