GNU Mailutils Manual (split by node):   Section:   Chapter:     FastForward: Libraries   Contents: Table of ContentsIndex: Function Index

Passing Options to Scheme

Passing Options to Scheme

Sometimes it is necessary to pass some command line options to the scheme procedure. There are three ways of doing so.

When using --source (-s) option, the rest of the command line following the option’s argument is passed as the args argument to the guimb-getopt function, if such function is defined. This allows for making guimb scripts executable by the shell. If your system supports ‘#!’ magic at the start of scripts, add the following two lines to the beginning of your script to allow for its immediate execution:

#! /usr/local/bin/guimb -s

(replace ‘/usr/local/bin/’ with the actual path to the guimb).

Otherwise, if you use the --file option, the additional arguments can be passed to the Scheme program -g (--guile-arg) command line option. For example:

guimb --guile-arg -opt --guile-arg 24 --file progfile

In this example, the guimb-getopt function will get the following argument

( '-opt' 24 )

Finally, if there are many arguments to be passed to Scheme, it is more convenient to enclose them in -{ and -} escapes:

guimb -{ -opt 24 -} --file progfile