Bug 9287 – DMD should read from stdin when an input file is "-"
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-01-09T05:44:15Z
Last change time
2017-08-16T13:24:08Z
Keywords
pull
Assigned to
No Owner
Creator
Alex Rønne Petersen
Comments
Comment #0 by alex — 2013-01-09T05:44:15Z
This is consistent with behavior in most other language compilers (and tools in general).
Comment #1 by alex — 2013-01-09T05:46:30Z
Scratch that, it should read from stdin if "-" is one of the input files. Doesn't have to be the only one.
Comment #2 by andrej.mitrovich — 2013-01-10T10:24:49Z
This is problematic because DMD uses single dash for arguments, if you accidentally run DMD with:
$ dmd -arg1 - arg2 -arg3
You're going to get some pretty awful error messages if DMD tries to read this.
But you can already use RDMD for this via `--eval=code`, why reimplement this in DMD?
(In reply to Andrej Mitrovic from comment #2)
> This is problematic because DMD uses single dash for arguments, if you
> accidentally run DMD with:
>
> $ dmd -arg1 - arg2 -arg3
>
> You're going to get some pretty awful error messages if DMD tries to read
> this.
This is normal for Linux. Look at:
man cat
and there are both - prefixed switches and - meaning read from stdin.