On Thu, May 17, 2007 at 01:53:44AM -0700, Patrick Collison wrote:
Hi,
Using latest SVN Squeak, I'm having trouble passing arguments to an image.
As far as I can see from the usage, it looks like "squeak foo.image bar" should pass bar as an argument to the image. Instead, though, I get a load error (the problem seems to be that Squeak is trying to load the url "file:bar" using the CodeLoader).
Is this a bug, or am I doing something wrong?
Patrick,
By convention, the first argument after the image name and any VM arguments is used to name a script file that is evaluated when the image starts. For most Squeak images, you give the name of the script file in the form of a fully qualified url such as 'file:///home/myaccount/mysqueakdir/myscript.st'. The script file can contain Smalltalk expressions in "bang format", the same format used for file-in and file-out. Thus you could have a script file called "myscript.st" containing a Smalltalk expression like this: "Smalltalk inspect ! "
There is a preference setting that you can use to control this: help... -> preferences... -> general -> readDocumentAtStartup
I am guessing that you are using a Unix VM; if so, there is a man page ("man squeak") that gives some explanation. Also, "squeak -h" will give some help, and there is a note at the bottom of the help output that says "The first <argument> normally names a Squeak `script' to execute."
Dave