diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-07-16 22:05:00 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-07-16 22:05:00 -0700 |
commit | 443a66458ff2e2716cbc67ba10fe9c71b0ed3fcd (patch) | |
tree | 13409a1c618a9286acf0321bc44c0098d4c2b6d2 | |
parent | 5b6b7906c62397adc7a0377daabcd6555d5d9ea1 (diff) | |
download | txr-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.
-rw-r--r-- | share/txr/stdlib/getopts.tl | 6 | ||||
-rw-r--r-- | txr.1 | 4 |
2 files changed, 8 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)))) @@ -47137,6 +47137,10 @@ or .code E followed by a decimal integer which may have a leading positive or negative sign, and include leading zeros. +.coIP :text +This type indicates a simple textual argument. The argument is taken as +verbatim UTF-8 text, converted to a string without interpreting +the characters in any special way. .coIP :str This type indicates that the argument consists of the interior notation of a TXR Lisp character string. It is processed by adding a double quote |