Get all files imported by a D source file

wobbles via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Sep 9 03:03:01 PDT 2016


On Thursday, 8 September 2016 at 07:20:52 UTC, Yuxuan Shui wrote:
> On Thursday, 8 September 2016 at 06:33:00 UTC, Jacob Carlborg 
> wrote:
>> On 2016-09-08 07:39, Yuxuan Shui wrote:
>>> Hi,
>>>
>>> I wonder if there's standardized way to gather which files 
>>> are imported
>>> by a source file. I know I can run "dmd -v" and look for 
>>> lines start
>>> with "import", but I don't know if this is the best way to do 
>>> it.
>>
>> You can use the "-deps" flag.
>
> -deps is even noisier than just -v...

It's pretty noisy alright, but it's also pretty easy to read...

It also shows just how coupled phobos is.
I'm importing one single function (std.stdio.writefln), and all 
the dependencies are imported:
http://pastebin.com/DSC4JhBD




More information about the Digitalmars-d-learn mailing list