Open wilzbach opened 6 years ago
Comment author: Andre <andre@s-e-a-p.de>
Similiar to the -stdin enhancement for dmd (https://github.com/dlang/dmd/pull/6880) it would make sense to implement it for rdmd too. This would enable following command:
echo import std.stdio; void main() { writeln("Success"); } | rdmd -
Comment author: hsteoh@quickfur.ath.cx
Doesn't rdmd already have --eval for this purpose?
Of course, being able to read from stdin has its own value (e.g., run rdmd on output produced by some code generating program via stdin, without needing to create a temporary file).
Comment author: @wilzbach
With 2.078.0 DMD will support cat foo.d | dmd -run -
which is probably what the creator was looking for?
Comment author: hsteoh@quickfur.ath.cx
No, this issue is asking for rdmd to support reading from stdin, not dmd.
Comment author: Andre <andre@s-e-a-p.de>
It's great dmd -run supports now -stdin. Thanks a lot. That is viable workaround.
I would like to keep this issue open to get the same functionality for rdmd, because:
cat foo.d | rdmd -
. Another benefit is, I always write the run argument wrong "--run". Be able to just write ...| rdmd -
is convenientComment author: hsteoh@quickfur.ath.cx
One advantage echo ... | rdmd -
has over echo ... | dmd --run -
is that rdmd inserts a bunch of standard imports into the code, so that you don't have to keep typing import std.stdio; ...
in every echo command.
So yes, this is still a valid ER.
Comment author: @wilzbach
Fair enough. BTW rdmd doesn't add imports by defaults - only rdmd --eval <string>
does.
Note: the issue was created automatically migrated from https://issues.dlang.org
Original bug ID: BZ#17985 From: Andre <andre@s-e-a-p.de> Reported version: D2 CC: @wilzbach, hsteoh@quickfur.ath.cx