shebang launcher for D programs

Bruno Medeiros brunodomedeiros+spam at com.gmail
Fri Mar 23 15:37:13 PDT 2007


Andrei Alexandrescu (See Website For Email) wrote:
> Anders F Björklund wrote:
>> Andrei Alexandrescu (See Website For Email) wrote:
>>
>>> In short, rundmd does what rdmd does but works on multi-module programs.
>>>
>>> I suspect other people have written similar scripts, but just in 
>>> case, I thought I'd ask. If people are interested, I'll be glad to 
>>> comb the script a little and post it here.
>>
>> Rebuild has a similar feature (-exec), but it's a program not a script.
>> I think build/bud also did, but I had problems with it and GDC/Tango...
> 
> Sounds great. Where is rebuild? (Bud aka build is easy to find on 
> dsource.org).
> 
>> Not sure how you pass runtime / program arguments over to it, though ?
>> But it does parse and compile all the imported modules for the program.
> 
> (The way I do it is simple but ambiguous - any flags that come before 
> the program name are passed to dmd, and any stuff that comes after the 
> program name is considered that program's arguments. The program name is 
> the first thing without a leading "-".)
> 
> I think such a tool should be part of the standard distribution - it's 
> very, very useful.
> 
> 
> Andrei

I agree, from first hand experience. I've made some D scripts myself, 
and there are some modules that I use often in such D scripts, such that 
I had to create a shell script wrapper to automatically include those 
module libs in D script compilation. (although I guess I could have put 
them in the shebang line as well, but that was more annoying)

-- 
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d mailing list