Yes I read rdmd but I didn't notice @cmd that was on dmd help, my
fault!

However as I said in my second post, probably it won't solve the
problem: shebang is useful if  you can write a "self-contained"
script, something that fits inside a single file.

I agree with Andrei. It would be a good solution for my case and
it shouldn't break anything.


On Thursday, 9 January 2014 at 21:39:09 UTC, Andrei Alexandrescu
wrote:
On 1/9/14 3:25 AM, Andrea Fontana wrote:
I've just discovered that shebang line has a (very short) limit. Only
127 bytes are read from line

It means that something like this doesn't work:

#!/usr/bin/rdmd --shebang -I/asdasdasdasd/asdasdasdasd/asdasdasdasd
-I/qweqweqweqwe/qweqweqweqwe/qweqweqweqwe/qweqweqweqwe/qweqweqweqwe/qweqweqweqwe/


Is it possible to add a command line switch to read params from a simple
file?

For example:


main.d:
#!/usr/bin/rdmd --shebang --params ./rdmd-params.conf
void main() { }

rdmd-params.conf:
-I/asdasdasdasd/asdasdasdasd/asdasdasdasd
-I/qweqweqweqwe/qweqweqweqwe/qweqweqweqwe/qweqweqweqwe/qweqweqweqwe/qweqweqweqwe/

I think that's a shell limitation. I've long had the plan to experiment with it like this: if --shebang is the first argument, rdmd should just read the whole first line and exec() a shell with it. That would solve a variety of issues related to limitations and quoting quirks.

Andrei

Reply via email to