diff options
author | Paul A. Patience <paul@apatience.com> | 2022-02-02 20:00:10 -0500 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-02-02 17:29:37 -0800 |
commit | 392250a43292391b0dfb3c823eff95b5785455b2 (patch) | |
tree | 3577a8c98c053e58accdfe4a275a7d70c7ffd103 /stdlib | |
parent | ae57a36b49557f8f5b55df22b308ed1ce4de2385 (diff) | |
download | txr-392250a43292391b0dfb3c823eff95b5785455b2.tar.gz txr-392250a43292391b0dfb3c823eff95b5785455b2.tar.bz2 txr-392250a43292391b0dfb3c823eff95b5785455b2.zip |
getopts: fix display of overlong-option help text.
* stdlib/getopts.tl (opthelp): If the long/short part of an
option description is 34 characters long or more, print the help
text starting on the next line, lest it be glued to the
long/short part (i.e., without an intervening space) and extend
too far to the right.
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/getopts.tl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/stdlib/getopts.tl b/stdlib/getopts.tl index 1d714126..e448c130 100644 --- a/stdlib/getopts.tl +++ b/stdlib/getopts.tl @@ -294,7 +294,9 @@ (long long) (short `@{"" 21} @short`))) (lines (if od.helptext (sys:wdwrap od.helptext 43)))) - (put-line ` @{ls 34}@(pop lines)` stream) + (if (>= (len ls) 34) + (put-line ` @ls` stream) + (put-line ` @{ls 34}@(pop lines)` stream)) (while lines (put-line ` @{"" 34}@(pop lines)` stream)))) (put-line : stream) |