[Pharo-project] Convention to build cmd-line interfaces with Pharo?

Stefan Marr pharo at stefan-marr.de
Sun May 15 11:13:04 CEST 2011


Is there any convention/standard approach to build nice cmd-line interfaces with Pharo?

The first road block I encountered is the assumption that the first argument to the image on the command line is a document/script. Which fires an exception if it is not actually a loadable document.

I did not see any way to disable that other than to deinstall Autostart (Autostart>>deinstall).

That is fine for me, but might have unintended consequences.
The ProjectLauncher>>startUpAfterLogin is the actual place where that assumption is hard coded.
And, well, I don't know what the consequences are of disabling Autostart and as a consequence ProjectLauncher.

So, are there other ways to get to a clean command-line interface?

What I want eventually is the following:

$ squeak-vm.sh Pharo-1.2.image --help
SMark Benchmark Framework, version: SMark-StefanMarr.12

Usage: <vm+image> SMarkHarness [runner] [reporter] <suiteOrBenchmark>
                               [iterations [processes [problemSize]]]

 runner             optional, a SMarkRunner class that executes the benchmarks
 reporter           optional, a SMarkReporter class that processes
                              and displays the results
 suiteOrBenchmark   required, either a SMarkSuite with benchmarks,
                              or a benchmark denoted by Suite.benchName
 iterations         optional, number of times the benchmarks are repeated
 processes          optional, number of processes/threads used by the benchmarks
 problemSize        optional, depending on benchmark for instance number of
                              inner iterations or size of used data set

Bye the way, Squeak 4.1 exhibits the same behavior, but I did not notice anything alike in our 3.9 image, there is works just fine.

Best regards

Stefan Marr
Software Languages Lab
Vrije Universiteit Brussel
Pleinlaan 2 / B-1050 Brussels / Belgium
Phone: +32 2 629 2974
Fax:   +32 2 629 3525

More information about the Pharo-project mailing list