pharo wrapper script suggestion and a question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

pharo wrapper script suggestion and a question

t olschewski
what do you think about modifiying the wrapper script pharo.sh (OneClick edition) slightly in order to alleviate scripting:

a) pharo.sh: passing "$@" over to pharo:

...
exec "$BASE/pharo" \
        ...
        ...
        "$ROOT/Contents/Resources/pharo.image" \
        "$@"

b) making a second script, pharo-headless.sh:

...
exec "$BASE/pharo" \
        -headless \
        ...
        ...
        "$ROOT/Contents/Resources/pharo.image" \
        "$@"

Test:

pharo-headless anyScript.st

And another Question:

is there a better way of forcing "pharo -headless" to quit, better than writing "WorldState quitSession." in every script ?
Reply | Threaded
Open this post in threaded view
|

Re: pharo wrapper script suggestion and a question

Sven Van Caekenberghe

On 23 Nov 2011, at 12:39, t olschewski wrote:

> what do you think about modifiying the wrapper script pharo.sh (OneClick
> edition) slightly in order to alleviate scripting:
>
> a) pharo.sh: passing "$@" over to pharo:
>
> ...
> exec "$BASE/pharo" \
>        ...
>        ...
>        "$ROOT/Contents/Resources/pharo.image" \
>        "$@"

Yes, that might be useful.

> b) making a second script, pharo-headless.sh:
>
> ...
> exec "$BASE/pharo" \
>        -headless \
>        ...
>        ...
>        "$ROOT/Contents/Resources/pharo.image" \
>        "$@"
>
> Test:
>
> pharo-headless anyScript.st

Again, useful indeed.

But the question remains if the one-click needs this: once you are working at that level, I would consider you an advanced user combining its own images and vm's.

BTW, I always use -vm-display-null and -vm-sound-null, because -headless does not always work, I am not sure what the preferred/official way is.

> And another Question:
>
> is there a better way of forcing "pharo -headless" to quit, better than
> writing "WorldState quitSession." in every script ?

To start a server, it is more handy that there is no automatic quit.
But for simple scripting thus is annoying, yes,

Sven



Reply | Threaded
Open this post in threaded view
|

Re: pharo wrapper script suggestion and a question

t olschewski
Sven Van Caekenberghe wrote
But the question remains if the one-click needs this: once you are working at that level, I would consider you an advanced user combining its own images and vm's.
it's not that high a hurdle or no hurdle at all to people already using pharo, agreed.

But maybe to an unknown number of python-, ruby-, tcl-, scheme- etc. -users
principally interested in trying smalltalk, expecting that running a script
should be as easy as python foo.py, ruby foo.rb, tcl foo.tcl. As should be
accessing stdin/out and command line arguments.