Changeset 40540 in project


Ignore:
Timestamp:
09/13/21 23:27:57 (12 days ago)
Author:
Jim Ursetto
Message:

4/args: Wrap long options in args:usage (@tkurtbond)

Location:
release/4/args/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/4/args/trunk/args-examples.scm

    r36931 r40540  
    1818          (print "elephant: arg is " arg))
    1919        (args:make-option (f file)      (required: "NAME") "parse file NAME")
     20        (args:make-option (l really-long-option-name) (required: "NAME") "very long option NAME to show wrapping")
    2021        (args:make-option (v V version) #:none     "Display version"
    2122          (print "args-examples $Revision: 1.16 $")
  • release/4/args/trunk/args.scm

    r32428 r40540  
    208208  (let ((option-string (commify o)))
    209209    (string-append (spaces (args:indent))
    210                    (string-pad-right option-string (args:width))
    211                    (args:option-docstring o) "\n")))
     210                  (if (>= (+ (args:indent) (string-length option-string))
     211                          (args:width))
     212                      (string-append option-string "\n"
     213                                     (string-pad-right "" (+ (args:width)
     214                                                             (args:indent)))
     215                                     (args:option-docstring o) "\n")
     216                      (string-append
     217                       (string-pad-right option-string (args:width))
     218                       (args:option-docstring o) "\n")))))
    212219
    213220;;; procedure: (args:usage OPTION-LIST)
  • release/4/args/trunk/args.setup

    r32428 r40540  
    1010 'args
    1111 `(,(dynld-name "args") ,(dynld-name "args.import") )
    12  `((version 1.5.1)
     12 `((version 1.6.1)
    1313   (documentation "args.html")
    1414   ))
Note: See TracChangeset for help on using the changeset viewer.