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?
Comment #3 by hsteoh — 2017-06-09T22:00:39Z
Comment #4 by bugzilla — 2017-06-10T01:35:39Z
(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.
Comment #5 by bugzilla — 2017-06-10T01:36:04Z
Comment #6 by github-bugzilla — 2017-08-01T19:47:30Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/7d1813309a8c89c8349672ba37a8c15f9d5a42a2 Fix issue 9287 - implement reading source from stdin. https://github.com/dlang/dmd/commit/28daf534a405e9a07d42afb8f978d8746be7b89a Merge pull request #6880 from quickfur/stdin Issue 9287 - Implement -stdin. merged-on-behalf-of: unknown
Comment #7 by github-bugzilla — 2017-08-07T13:17:44Z
Commits pushed to newCTFE at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/7d1813309a8c89c8349672ba37a8c15f9d5a42a2 Fix issue 9287 - implement reading source from stdin. https://github.com/dlang/dmd/commit/28daf534a405e9a07d42afb8f978d8746be7b89a Merge pull request #6880 from quickfur/stdin
Comment #8 by github-bugzilla — 2017-08-16T13:24:08Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/7d1813309a8c89c8349672ba37a8c15f9d5a42a2 Fix issue 9287 - implement reading source from stdin. https://github.com/dlang/dmd/commit/28daf534a405e9a07d42afb8f978d8746be7b89a Merge pull request #6880 from quickfur/stdin