diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-08-17 17:52:01 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-08-17 17:52:01 +0200 |
commit | 6a219c59e6506ee5326822a7ced0e6cd92b7b628 (patch) | |
tree | 3cf44cef098fb0a98137abd7942d8aa10592ddfc /module/entry-points/text.scm | |
parent | stuff. (diff) | |
download | calp-6a219c59e6506ee5326822a7ced0e6cd92b7b628.tar.gz calp-6a219c59e6506ee5326822a7ced0e6cd92b7b628.tar.xz |
Move a bunch of files into calp module.
Diffstat (limited to 'module/entry-points/text.scm')
-rw-r--r-- | module/entry-points/text.scm | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/module/entry-points/text.scm b/module/entry-points/text.scm deleted file mode 100644 index d6ebd72e..00000000 --- a/module/entry-points/text.scm +++ /dev/null @@ -1,29 +0,0 @@ -(define-module (entry-points text) - :export (main) - :use-module (text flow) - :use-module (ice-9 getopt-long) - :use-module (util io) - :use-module (util options) - ) - - -(define options - '((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.")) - (help (single-char #\h) - (description "Prints this help.")))) - -(define (main args) - (define opts (getopt-long args (getopt-opt options))) - - (when (option-ref opts 'help #f) - (print-arg-help options) - (throw 'return)) - - (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)))) |