Changeset 25392 in project


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

Anonymous wiki edit for IP [129.174.190.17]: Completed documentation

File:
1 edited

Legend:

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

    r24516 r25392  
    148148                 "--rnet-server=lamprod" "--" "-fred" "foo2" "foo3")
    149149    grammar)
     150</enscript>
     151
     152This returns a structure like ((@ . (fool foo2 foo3)) (v) (k . /tmp) (x-includes . /usr/include) (rnet-server . lamprod)), which must be passed along with grammar to make-option-dispatch.
     153
     154<enscript highlight=scheme>
     155(let ((options (make-option-dispatch (getopt-long '("my-prog" "-vk" "/tmp" "foo1" "--x-includes=/usr/include" "--rnet-server=lamprod" "--" "-fred" "foo2" "foo3")
     156                                   grammar)
     157                      grammar)))
     158
     159     ...)
     160</enscript>
     161
     162Once the options have been made into a dispatch, they can be accessed by passing symbols to the dispatch.
     163
     164<enscript highlight=scheme>
     165(options 'lockfile-dir)
     166
     167-> "/tmp"
     168
     169(options 'verbose)
     170
     171-> #t
     172
     173...
    150174</enscript>
    151175
Note: See TracChangeset for help on using the changeset viewer.