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...command-line function returns
a list of strings of the form (script arg...).
It is possible to name a file using a leading hyphen, for example, -myfile.scm. In this case, the file name must be preceded by -s to tell Guile that a (script) file is being named.
Scripts are read and evaluated as Scheme source code just as the
load function would. After loading script, Guile exits.
-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...command-line function returns a list of strings of the form
(guile arg...), where guile is the path of the
Guile executable.
-L directory-x extension%load-extensions). The specified extensions
are tried in the order given on the command line, and before the default
load extensions. Extensions added here are not in effect during
execution of the user's .guile file.
-l file-e functioncommand-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
correspond to the (@ ...) read syntax that can be used in
normal code. See Using Guile Modules and Scripting Examples.
-dsThis 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.
\--use-srfi=listcond-expand when this option is used.
Here is an example that loads the modules SRFI-8 ('receive') and SRFI-13 ('string library') before the GUILE interpreter is started:
guile --use-srfi=8,13
--debugBy default, the debugging VM engine is only used when entering an
interactive session. When executing a script with -s or
-c, the normal, faster VM is used by default.
--no-debugNote that, despite the name, Guile running with --no-debug
does support the usual debugging facilities, such as printing a
detailed backtrace upon error. The only difference with
--debug is lack of support for VM hooks and the facilities that
build upon it (see above).
-q--listen[=p]If p is not given, the default is local port 37146. If you look at it upside down, it almost spells “Guile”. If you have netcat installed, you should be able to nc localhost 37146 and get a Guile prompt. Alternately you can fire up Emacs and connect to the process; see Using Guile in Emacs for more details.
Note that opening a port allows anyone who can connect to that port—in the TCP case, any local user—to do anything Guile can do, as the user that the Guile process is running as. Do not use --listen on multi-user machines. Of course, if you do not pass --listen to Guile, no port will be opened.
That said, --listen is great for interactive debugging and
development.
--auto-compile--fresh-auto-compile--no-auto-compile-h, --help-v, --version