Back: Using GNU Smalltalk
Up: Using GNU Smalltalk
Forward: Operation
 
Top: GNU Smalltalk User's Guide
Contents: Table of Contents
Index: Class index
About: About this document

2.1 Command line arguments

GNU Smalltalk may be invoked via the following command:
 
gst [ flags ... ] [ file ... ]

When you first invoke GNU Smalltalk, it will attempt to see if any of the kernel method definition files are newer than the last saved binary image in the current directory (if there is one). If there is a newer kernel method definition file, or if the binary image file (called `gst.im') does not exist, a new binary image will be built by loading in all the kernel method definition files, performing a full garbage collection in order to compact the space in use, and then saving the resulting data in a position independent format. Your first invocation should look something like this:

 
"Major GC flip... done, used space = 51%"
GNU Smalltalk Ready

st>

If you specify file, that file will be read and executed and Smalltalk will exit when end of file is reached. If you specify more than one file, each will be read and processed in turn. If you don't specify file, standard input is read, and if the standard input is a terminal, a prompt is issued. You may specify `-' for the name of a file to invoke an explicit read from standard input; furthermore, specifying `--' stops the interpretation of options so that every argument that follows is considered a file name even if it begins with a minus.

You can specify both short and long flags; for example, `--version' is exactly the same as `-v', but is easier to remember. Short flags may be specified one at a time, or in a group. A short flag or a group of short flags always starts off with a single dash to indicate that what follows is a flag or set of flags instead of a file name; a long flag starts off with two consecutive dashes, without spaces between them.

In the current implementation the flags can be intermixed with file names, but their effect is as if they were all specified first. The various flags are interpreted as follows:

-a --smalltalk
Used to make arguments available to Smalltalk code. The C option parser discards everything after the parameter including -a, while Smalltalk code can get it sending the arguments message to the Smalltalk object.

Examples:
command line Options seen by GNU Smalltalk Smalltalk arguments
(empty) (none) #()
-Via foo bar -Vi #('foo' 'bar')
-Vai test -Vi #('test')
-Vaq -Vq #()
--verbose -aq -c --verbose -q #('-c')

That should be clear.

-c --core-dump
When this flag is set and a fatal signal occurs, a core dump is produced after an error message is printed. Normally, the backtrace is produced and the system terminates without dumping core.

-d --user-declaration-trace
Declaration tracing prints the class name, the method name, and the byte codes that the compiler is generating as it compiles methods. Only for files that are named explicitly on the command line; kernel files that are loaded automatically as part of rebuilding the image file do not have their declarations traced.

-D --kernel-declaration-trace
Like the -d flag, but also includes declarations processed for the kernel files.

-e --user-execution-trace
Prints the byte codes being executed as the interpreter operates. Only works for those executions that occur after the kernel files have been loaded and the image file dumped.

-E --kernel-declaration-trace
Like the -e flag, but includes all byte codes executed, whether they occur during the loading of the kernel method definition files, or during the loading and execution of user files.

-g --no-gc-messages
Suppress garbage collection messages.

-h -H -? --help
Prints out a brief summary of the command line syntax of GNU Smalltalk, including the definitions of all of the option flags, and then exits.

-i --rebuild-image
Ignore the saved image file; always load from the kernel method definition files. Setting this flag bypasses the normal checks for kernel files newer than the image file, or the image file's version stamp out of date with respect to the Smalltalk version. After the kernel definitions have been loaded, a new image file will be saved.

-I file --image-file file
Use the image file named file as the image file to load. Completely bypasses checking the file dates on the kernel files and standard image file.

-l --log-changes
Produce a log of the compiled Smalltalk code to st-changes.st, in the current working directory.

-L file --log-file file
Produce a log of the compiled Smalltalk code to the file named file.

-q --quiet --silent
Suppress the printing of execution information while GNU Smalltalk runs. Messages about the beginning of execution or how many byte codes were executed are completely suppressed when this flag is set.

-Q --no-messages
Suppress the printing of execution information and any other informative message while GNU Smalltalk runs. Useful, for example, for stand-alone shell programs such as CGI scripts.

-r --regression-test
Disables certain informative I/O; this is used by the regression testing system and is probably not of interest to the general user.

-s --store-no-source
Usually, GNU Smalltalk stores the methods' source code as FileSegments for files in the kernel directory, and as Strings for files outside it. This behavior minimizes problems on recompile, because FileSegments cannot be relied upon if the source file changes. However, storing source code for big libraries is not useful, since the file-in source is unlikely to change. There are two ways to override this behavior and make GNU Smalltalk store everything loaded in a particular session as FileSegments: one is to specify a directory relative to the kernel directory, such as `/usr/local/smalltalk/kernel/../blox/Blox.st'; the other is to specify this option on the command line.

-S --snapshot
Save a snapshot after loading files from the command line. Of course the snapshot is not saved if you include - (stdin) on the command line and exit by typing Ctrl-C.

-v --version
Prints out the Smalltalk version number, then exits.

-V --verbose
Enables verbose mode. When verbose mode is on, various diagnostic messages are printed (currently, only the name of each file as it's loaded).

-y --yacc-debug
Turns on parser debugging. Not typically used.




This document was generated on May, 12 2002 using texi2html