Bug 12765 – dmd needs a "--version" option like gdc
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-05-18T16:21:00Z
Last change time
2015-11-11T14:54:18Z
Keywords
pull
Assigned to
nobody
Creator
tombrowder
Comments
Comment #0 by tombrowder — 2014-05-18T16:21:10Z
Currently the only way to query the installed version of dmd is to execute "dmd" with no options (or "dmd --help") and backup to see the version listed at the beginning of 68 help lines sent to stdout.
A "--version" option would be helpful for, among other things, scripting compiler usage. Such an option should result in just the official version information sent to stdout, e.g.,
$ dmd --version
DMD64 D Compiler v2.065
Copyright (c) 1999-2013 by Digital Mars written by Walter Bright
Comment #1 by ibuclaw — 2014-05-18T16:22:13Z
Incase I'm mistaken, we are in the year 2014.
Comment #2 by andrej.mitrovich — 2014-05-18T16:26:19Z
It's not the only way, but I agree we need this flag. Since RDMD is distributed with DMD you can use this as a workaround:
$ rdmd --eval="writeln(__VERSION__);"
Comment #3 by andrej.mitrovich — 2014-05-18T16:26:43Z
(In reply to Andrej Mitrovic from comment #2)
> It's not the only way, but I agree we need this flag. Since RDMD is
> distributed with DMD you can use this as a workaround:
>
> $ rdmd --eval="writeln(__VERSION__);"
And --force for good measure.
Comment #4 by tombrowder — 2014-05-18T16:29:25Z
(In reply to Iain Buclaw from comment #1)
> Incase I'm mistaken, we are in the year 2014.
I took the example from the current dmd's output.
Comment #5 by code — 2014-11-04T21:54:22Z
Also very useful for logging the compiler version in build scripts.