| www.delorie.com/gnu/docs/guile/guile_34.html | search |
![]() Buy GNU books! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
getopt-long The grammar argument is expected to be a list of this form:
((option (property value) ...) ...)
where each option is a symbol denoting the long option, but
without the two leading dashes (e.g. version if the option is
called --version).
For each option, there may be list of arbitrarily many property/value pairs. The order of the pairs is not important, but every property may only appear once in the property list. The following table lists the possible properties:
(single-char char)
-char as a single-character equivalent to
--option. This is how to specify traditional Unix-style
flags.
(required? bool)
getopt-long will
raise an error if it is not found in args.
(value bool)
#t, the option accepts a value; if it is
#f, it does not; and if it is the symbol optional, the
option may appear in args with or without a value.
(predicate func)
(value #t) for
this option), then getopt-long will apply func to the
value, and throw an exception if it returns #f. func
should be a procedure which accepts a string and returns a boolean
value; you may need to use quasiquotes to get it into grammar.
getopt-long's args parameter is expected to be a list of
strings like the one returned by command-line, with the first
element being the name of the command. Therefore getopt-long
ignores the first element in args and starts argument
interpretation with the second element.
getopt-long signals an error if any of the following conditions
hold.
--opt=value syntax).
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |