[Omake] "#!" processing.
Aleksey Nogin
nogin at metaprl.org
Fri Apr 27 17:06:11 PDT 2007
On 27.04.2007 16:42, Jason Hickey wrote:
> The advantage of the #! parsing is that it is more predictable, because the file is processed the same way no matter how you execute it ("./script" is the same as "osh ./script").
The standard Unix interpretation of the "#!" allows passing at most one
argument. If a file "f" starts with
#!foo bar baz
then "./f" is equivalent to "foo 'bar baz' ./f"
If you want both forms to be processed the same, you need to enforce
that restriction. If you want to allow passing multiple flags using this
mechanism, you have to allow multiple space-separated options within the
second argv element. (BTW, the good news about the single-option
restriction is that we do not have to worry about constructs like
"#!/usr/bin/env -i HOME=... ... osh ...").
Currently, the set of options available on the command line (omake_main)
and via the OMakeFlags is different (e.g. debugging flags are only
allowed on the command line). What do we do about it?
If you still think that the "#!" parsing is the way to go, then we
should probably drop the current unfinished implementation off the
0.9.8.2 branch (and possibly even 0.9.8.x) and make sure we address all
these issues once the more complete parse-time handling of "#!" lands on
the "trunk".
Aleksey
More information about the OMake-Devel
mailing list