Improve formatting of options help given long option names
authorMark H Weaver <mhw@netris.org>
Sun, 14 Oct 2012 00:28:27 +0000 (20:28 -0400)
committerMark H Weaver <mhw@netris.org>
Wed, 17 Oct 2012 08:48:40 +0000 (04:48 -0400)
* module/ice-9/boot-9.scm (define-option-interface): When printing
  options help, e.g. for (read-options 'help), expand the width of the
  first column by another tab stop, to accommodate option names of up to
  23 characters.

module/ice-9/boot-9.scm

index cf8252a..d679f6e 100644 (file)
@@ -2850,8 +2850,11 @@ module '(ice-9 q) '(make-q q-length))}."
                 (lambda (option)
                   (apply (lambda (name value documentation)
                            (display name)
-                           (if (< (string-length (symbol->string name)) 8)
-                               (display #\tab))
+                           (let ((len (string-length (symbol->string name))))
+                             (when (< len 16)
+                               (display #\tab)
+                               (when (< len 8)
+                                 (display #\tab))))
                            (display #\tab)
                            (display value)
                            (display #\tab)