Next: The Meta Switch, Previous: The Top of a Script File, Up: Guile Scripting
Here we describe Guile's command-line processing in detail. Guile processes its arguments from left to right, recognizing the switches described below. For examples, see Scripting Examples.
-s
script arg...load
function would. After loading script, exit. Any
command-line arguments arg... following script become the
script's arguments; the command-line
function returns a list of
strings of the form (
script arg...)
.
-c
expr arg...command-line
function returns a list of strings of the form
(
guile arg...)
, where guile is the path of the
Guile executable.
--
arg...--
become command-line arguments for the interactive session; the
command-line
function returns a list of strings of the form
(
guile arg...)
, where guile is the path of the
Guile executable.
-L
directory-l
file-e
function-s
) or evaluating the expression (with
-c
), apply function to a list containing the program name
and the command-line arguments — the list provided by the
command-line
function.
A -e
switch can appear anywhere in the argument list, but Guile
always invokes the function as the last action it performs.
This is weird, but because of the way script invocation works under
POSIX, the -s
option must always come last in the list.
The function is most often a simple symbol that names a function
that is defined in the script. It can also be of the form (@
module-name symbol)
and in that case, the symbol is
looked up in the module named module-name.
For compatibility with some versions of Guile 1.4, you can also use the
form (symbol ...)
(that is, a list of only symbols that doesn't
start with @
), which is equivalent to (@ (symbol ...)
main)
, or (symbol ...) symbol
(that is, a list of only symbols
followed by a symbol), which is equivalent to (@ (symbol ...)
symbol)
. We recommend to use the equivalent forms directly since they
corresponf to the (@ ...)
read syntax that can be used in
normal code, See Using Guile Modules.
See Scripting Examples.
-ds
-s
option as if it occurred at this point in the
command line; load the script here.
This switch is necessary because, although the POSIX script invocation
mechanism effectively requires the -s
option to appear last, the
programmer may well want to run the script before other actions
requested on the command line. For examples, see Scripting Examples.
\
--emacs
#t
.
This switch is still experimental.
--use-srfi=
list--use-srfi
expects a comma-separated list of numbers,
each representing a SRFI number to be loaded into the interpreter
before starting evaluating a script file or the REPL. Additionally,
the feature identifier for the loaded SRFIs is recognized by
`cond-expand' when using this option.
guile --use-srfi=8,13
--debug
-s
or -c
, the normal, faster evaluator is used by default.
--no-debug
-h
, --help
-v
, --version