aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-05-04 17:36:41 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-05-04 17:36:41 +0200
commitc369d0993df8b907291d056ea743aab2ac0511c9 (patch)
treefd40453b5b11535ec977861e3f9bb7794a99acf8
parentRepair term + add --help. (diff)
downloadcalp-c369d0993df8b907291d056ea743aab2ac0511c9.tar.gz
calp-c369d0993df8b907291d056ea743aab2ac0511c9.tar.xz
text main should now read it's arguments.
-rw-r--r--module/entry-points/text.scm14
1 files 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))))