summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-07-16 22:05:00 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-07-16 22:05:00 -0700
commit443a66458ff2e2716cbc67ba10fe9c71b0ed3fcd (patch)
tree13409a1c618a9286acf0321bc44c0098d4c2b6d2 /share
parent5b6b7906c62397adc7a0377daabcd6555d5d9ea1 (diff)
downloadtxr-443a66458ff2e2716cbc67ba10fe9c71b0ed3fcd.tar.gz
txr-443a66458ff2e2716cbc67ba10fe9c71b0ed3fcd.tar.bz2
txr-443a66458ff2e2716cbc67ba10fe9c71b0ed3fcd.zip
getopts: New argument type :text.
* share/txr/stdlib/getopts.tl (opt-desc): New entry in valid-types, :text symbol. (sys:opt-parsed convert-type): Handle :text case. This is a no-op since :text applied no treatment. (opthelp): Provide help text for :text type. * txr.1: Documented :text getopts option type.
Diffstat (limited to 'share')
-rw-r--r--share/txr/stdlib/getopts.tl6
1 files changed, 4 insertions, 2 deletions
diff --git a/share/txr/stdlib/getopts.tl b/share/txr/stdlib/getopts.tl
index 3454b73f..21d892c7 100644
--- a/share/txr/stdlib/getopts.tl
+++ b/share/txr/stdlib/getopts.tl
@@ -32,7 +32,7 @@
helptext
arg-p
(type :bool)
- (:static valid-types '(:bool :dec :hex :oct :cint :float :str))
+ (:static valid-types '(:bool :dec :hex :oct :cint :float :str :text))
(:postinit (me)
me.(check)
(set me.arg-p (neq me.type :bool))))
@@ -125,6 +125,7 @@
(or (ignerr (read `"@{me.arg}"`))
(sys:opt-err "option ~a needs string lit syntax, ~a given"
name me.arg))))
+ (:text)
(t (cond
((and (consp type) (eq (car type) 'list))
(let* ((rec-type (cadr type))
@@ -332,6 +333,7 @@
\ 3., .5, .12e9, 53.e-3, 3e-015")
(:str " STR - String with embedded escapes, valid\
\ as TXR Lisp string literals\n\
- \ syntax: foo, foo\\tbar, abc\\nxyz"))))
+ \ syntax: foo, foo\\tbar, abc\\nxyz")
+ (:text " TEXT - Unprocessed text"))))
(put-line ln)))
(put-line))))