Support of -run and source code from stdin

Iain Buclaw ibuclaw at gdcproject.org
Thu May 28 04:58:26 UTC 2020


On Wednesday, 27 May 2020 at 21:40:38 UTC, Andre Pany wrote:
> Hi,
> Dmd and ldc supports running source code from stdin:
>
> ```
> echo 'void main(){}' | dmd -run -
> ```
>
> It seems GDC does not support argument -run and I do not know

I see no obvious use for having something like -run in the 
driver. Toolchain apps are more than capable of doing this 
themselves.

> wheter it supports reading source code from stdin?
>

gdc -x d -

The -x tells gcc what language to parse, as the driver is capable 
of handling all languages gcc knows about, eg -xc++.

> Could this 2 featured be added to gdc?
> This would solve the probe file issue mentioned here 
> https://forum.dlang.org/post/uwxndbpxspwaofolksbr@forum.dlang.org
>

Looks like the description of the problem matches what this PR is 
fixing.

https://github.com/dlang/dub/pull/1941

Iain


More information about the D.gnu mailing list