rdmd configuration files

Jonathan Marler via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 11 14:33:24 PDT 2016


On Thursday, 11 August 2016 at 20:44:12 UTC, Lodovico Giaretta 
wrote:
> On Thursday, 11 August 2016 at 18:47:05 UTC, Jonathan Marler 
> wrote:
>> ...
>> Additionally, allowing rdmd to be configured through files 
>> makes more complicated configurations more reasonable.  For 
>> example, if your scripts depend on a dub package, you could do 
>> this easily in a configuration file, whereas doing this on the 
>> command line would be a nightmare.
>>
>
> In my opinion, adding this complexity to rdmd is overkill. When 
> you need to use this, IMHO, you should write a little shell 
> script that calls rdmd passing the correct arguments. It's very 
> easy, just a couple of lines of shell script. Maybe even a 
> one-liner.
>
> In file rdmd_wrapper.sh:
> rdmd -my-special -command-line -parameters $*
>
> When you call it this way:
> ./rdmd_wrapper mymodule.d
>
> It will execute this:
> rdmd -my-special -command-line -parameters mymodule.d
>
> If you need the same configuration really often, you can add 
> the wrapper to the path, so you can call it from everywhere.
>
> But this is just my opinion, many may disagree.

I don't necessarily agree or disagree with you, thanks for 
providing your opinion.  A wrapper script would certainly solve 
the simple cases.  The con is that it adds an extra layer to the 
script and every application will have their own solution which 
makes a project more isolated.  The wrapper script was the first 
solution that came to my mind but as I thought about 
configuration files, they seemed worth considering.

I'm curious what you think about the more complex operations that 
configuration files could facilitate. The example I gave was that 
this could enable a script to use dub package dependencies that 
are automatically downloaded and built by rdmd, but I'm sure 
there are other interesting use cases.  An argument could be made 
that this should go in an external tool rather then rdmd though, 
but that thought seemed a bit odd since rdmd is already a wrapper 
around dmd itself, but maybe that's ok.  Do you have any new 
features rdmd could support if it had configuration files?


More information about the Digitalmars-d mailing list