www.delorie.com/gnu/docs/guile/guile_30.html   search  
 
Buy GNU books!


Guile Reference Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.2 The (ice-9 getopt-long) Module

A script is free to parse and handle its command line arguments in any way that it chooses. Where the set of possible options and arguments is complex, however, it can get tricky to extract all the options, check the validity of given arguments, and so on. This task can be greatly simplified by taking advantage of the module (ice-9 getopt-long), which is distributed with Guile.

The (ice-9 getopt-long) module exports two procedures: getopt-long and option-ref.

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.

10.2.1 A Short getopt-long Example  A short getopt-long example.
10.2.2 How to Write an Option Specification  How to write an option specification.
10.2.3 Expected Command Line Format  The expected command line format.
10.2.4 Reference Documentation for getopt-long  Full documentation for getopt-long.
10.2.5 Reference Documentation for option-ref  Full documentation for option-ref.


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003