diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-05-04 17:36:41 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-05-04 17:36:41 +0200 |
commit | c369d0993df8b907291d056ea743aab2ac0511c9 (patch) | |
tree | fd40453b5b11535ec977861e3f9bb7794a99acf8 /module/entry-points/text.scm | |
parent | Repair term + add --help. (diff) | |
download | calp-c369d0993df8b907291d056ea743aab2ac0511c9.tar.gz calp-c369d0993df8b907291d056ea743aab2ac0511c9.tar.xz |
text main should now read it's arguments.
Diffstat (limited to 'module/entry-points/text.scm')
-rw-r--r-- | module/entry-points/text.scm | 14 |
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)))) |