Changeset 25393 in project


Ignore:
Timestamp:
10/20/11 03:17:53 (9 years ago)
Author:
svnwiki
Message:

Anonymous wiki edit for IP [129.174.190.17]: Added usage example

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/getopt-long

    r25392 r25393  
    172172
    173173...
     174</enscript>
     175
     176If the user types an invalid option, getopt-long will report an error. These can be handled with a custom error handler.
     177
     178<enscript highlight=scheme>
     179(define (u g)
     180        (display (format "Usage: myprog [options]\n~a" (usage g)))
     181        (exit))
     182
     183(with-exception-handler
     184                (lambda (e) (u grammar))
     185                (let* (
     186                        (options (make-option-dispatch (getopt-long args grammar) grammar))
     187                        ...)))
    174188</enscript>
    175189
Note: See TracChangeset for help on using the changeset viewer.