On Sep 21, 2010, at 8:16 53AM, Lukas Renggli wrote:
How does Pharo execute classes from the command line?
You can pass the filename of a .cs/.st file to the VM that gets filed-in on startup.
Is there a way to specify the class and the method to be called?
Not directly.
Are command line arguments available?
$ squeak --help Usage: squeak [<option>...] [<imageName> [<argument>...]] squeak [<option>...] -- [<argument>...]
BTW, dunno if it's a crossplatform Cog issue ( haven't checked others) but in John's new OSX Cog-based VMs (last tested 5.8b9), it doesn't look like the arguments are present in systemAttributes at position 2 onwards. Thus, ProjectLauncher will fail to execute scripts at all. In -help:
-encoding <enc> set the internal character encoding (default: MacRoman)
Sounds strangel, should probably be updated to Latin1/ removed (depending on how it's actually used)? Also, nonrelated to the VM, the comment in SmalltalkImage>>#documentPath seems misleading (not to mention the method name itself), there seems to be no conversion by the vm to absolute path going on in neither OSX nor Windows, the string is passed through raw. This is reinforced by the --help mentioning:
The first <argument> _normally_ names a Squeak `script' to execute.
Cheers, Henry