diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-05-04 17:37:54 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-05-04 17:37:54 +0200 |
commit | 4369e52443f927eef341e1adfe4b8acf291f6f0b (patch) | |
tree | 5f07420c83f734b59f106688df985bfdd4f8528b /module/entry-points/text.scm | |
parent | text main should now read it's arguments. (diff) | |
download | calp-4369e52443f927eef341e1adfe4b8acf291f6f0b.tar.gz calp-4369e52443f927eef341e1adfe4b8acf291f6f0b.tar.xz |
Add --help to text.
Diffstat (limited to 'module/entry-points/text.scm')
-rw-r--r-- | module/entry-points/text.scm | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/module/entry-points/text.scm b/module/entry-points/text.scm index 69bb1691..587beda3 100644 --- a/module/entry-points/text.scm +++ b/module/entry-points/text.scm @@ -3,16 +3,24 @@ :use-module (output text) :use-module (ice-9 getopt-long) :use-module (util io) + :use-module (util options) ) (define options - '((width (value #t) (single-char #\w)) - (file (value #t) (single-char #\f)) - )) + '((width (value #t) (single-char #\w) + (description "Width of written text, defaults to 70 chars.")) + (file (value #t) (single-char #\f) + (description (*TOP* "Read from " (i "file") " instead of standard input."))) + (help (single-char #\h) + (description "Prints this help.")))) (define (main args) - (define opts (getopt-long args options)) + (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 |