Command-line syntax,
shebang scripts (was Re: [ENH] Command-line argument access in the
image)
Brian Rice
water at tunes.org
Tue Dec 27 23:27:35 PST 2005
I've proceeded with changing the command-line argument convention to
require --image OR -i as an option keyword for specifying a non-
default image.
I also added support for #!-prefixed scripts to the load: function,
where it will ignore everything to the end of the line. In any case,
"#!/usr/local/bin/slate --load " as the first line of a marked-
executable Slate source file will make Slate load and run it
immediately. Specifying an image is now obviously possible for this
setup ("#!vm -i <image> --load"), which the previous command-line
grammar did not allow, and this was my reason for changing it.
Alpha images have been updated with the new load: method, and some VM
sources have been updated, but not the Pidgin core VM files.
In the future, I think the trick to keeping Slate easier to work with
is to improve the ability to use a standard image from anywhere. I
got a good suggestion to use argv[0], the program's name as invoked,
to select the directory where the default image will be searched-for.
This would also require slate.image to be installed with the VM in /
usr/local/lib/slate/, but this will probably not happen immediately.
There are some hack-ish possibilities for Windows users to get this
same kind of functionality, but for now I don't have definite ideas,
so I'm going to hold off unless someone assists with that.
On Dec 27, 2005, at 8:12 PM, Brian Rice wrote:
> On Dec 27, 2005, at 6:50 PM, Brian Rice wrote:
>> Also, boot.c currently processes its arguments in a simplistic
>> way, so that extra arguments that you want to pass to the image
>> must be followed by the image name. E.g.
>>
>> "slate --load src/lib/memoryarea.slate slate.image"
>>
>> Is generally needed; you cannot skip the image name yet. I may
>> write some code that does guess-work in trying to figure out if
>> the last argument is a valid image name, and then have it try the
>> default if that doesn't work.
>
> Another option is to require --image <filename> to specify an image
> file. This is more verbose, but it does keep everything unambiguous.
>
> Does anyone have a problem or preference among these options?
--
-Brian
http://tunes.org/~water/brice.vcf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : /archives/slate/attachments/20051227/54912843/PGP.pgp
More information about the Slate
mailing list