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.
Comment #6 by code — 2014-11-04T22:07:20Z
Comment #7 by github-bugzilla — 2014-11-05T01:22:21Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/cf73ebbff34311f0833c53a0391244dc53fd8390 Issue 12765 - dmd needs a "--version" option like gdc - move printing of compiler logo into separate function - add --version switch to only print version and copyright https://github.com/D-Programming-Language/dmd/commit/774e15712d3095369bb6bdd65ff69ad8ab48a856 Merge pull request #4112 from MartinNowak/fix12765 Issue 12765 - dmd needs a "--version" option like gdc
Comment #8 by github-bugzilla — 2015-02-18T03:39:15Z