On Tue, Sep 30, 2014 at 10:29:20PM +0200, Nicolas Cellier wrote:
2014-09-30 20:12 GMT+02:00 tim Rowledge tim@rowledge.org:
How are command line arguments intended for the image supposed to be dealt with these days? It???s an awfully long time since last I looked at this area and the code I???m seeing in the image is??? convoluted.
I need to be able to handle some simple cases for Scratch startup and we seem to have completely changed how that area is handled. I have come across (and reeled in horror) code in ProjectLauncher, AutoStart etc but so far I don???t see anything to make it all make sense in my head. I don???t suppose anybody knows of a correct wiki page? Not found one so far.
Maybe I need to drop one or more of the current startup related classes and write a ScratchStart class?
A good soul should take a look at Pharo and pick the good bytes from there
Good idea to take a look at the Pharo handling. But I think the Squeak handling has been pretty much unchanged for quite a while and it does still work. I'm using a unix VM, and there may be some platform differences, but the basic idea is that any command line parameters intended for the VM will be handled by the VM, and you then specify image name followed by document name followed by any other parameters that you may want to pass along to the image. The first thing after the image name is treated as a startup document, so that needs to be present if you intend to also pass along some other parameters. The remaining parameters are available to the image (evaluate "Smalltalk arguments"). Thus you can do something like this:
$ /usr/local/bin/squeak -vm-sound-pulse myImage.image myStartupDocument.st param1 param2 param3
The arguments #('param1' 'param2' 'param3') will be available for use in your myStartupDocument.st start script.
Dave