Next: SRFI Support, Previous: POSIX, Up: Guile Modules
The (ice-9 getopt-long)
module exports two procedures:
getopt-long
and option-ref
.
getopt-long
takes a list of strings — the command line
arguments — and an option specification. It parses the command
line arguments according to the option specification and returns a data
structure that encapsulates the results of the parsing.
option-ref
then takes the parsed data structure and a specific
option's name, and returns information about that option in particular.
To make these procedures available to your Guile script, include the
expression (use-modules (ice-9 getopt-long))
somewhere near the
top, before the first usage of getopt-long
or option-ref
.