On Tue, Sep 21, 2010 at 04:44:19PM +0200, Henrik Johansen wrote:
>
> On Sep 21, 2010, at 4:21 22PM, Nicolas Cellier wrote:
>
> > 2010/9/21 Henrik Johansen <[email protected]>:
> >> 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)?
> >>
> >
> > I bet less than 1 out of 1000 machines running squeak shall use this
> > MacRoman thing nowadays.
> >
> > Nicolas
>
> Just ran -help on 5.2.5 and 5.8b9, the -encoding option is not mentioned in
> any of those.
>
> The only current use case I could think of would be Cuis, who might want to
> set it to Latin15 in order to interpret ? correctly.
> Sure, the StrikeFonts (taken from Cuis) included in Pharo/Squeak actually
> cover Latin15 as well, but everywhere else, encoding of ByteStrings is
> assumed to be Latin1...
> So better with some visual discrepancies, namely displaying ? as ?, ? as ?,
> etc. than reading/writing the wrong characters to/from external sources
Regarding command line arguments available to the image, see
#getSystemAttribute:
Squeak has #argumentAt: for getting command line options passed to the image.
This is no longer present in Pharo, but the implementation is just this:
argumentAt: i
"Answer the i-th argument of the command line, or nil if not so many
argument."
^self getSystemAttribute: 2 + i
Dave
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project