Bugzilla – Bug 413
All tools need a --version command-line switch
Last modified: 2004-08-03 19:39:07
You need to log in before you can comment on or make changes to this bug.
As LLVM progresses and accumulates more versions behind it, I think it is necessary to allow users to inquire of the version number of the current tools. An implementation could be just a version.h file which defines the version and is #included by all tools. It would be preferrable for releases to have actual numbers, whereas checking out from CVS gets a version of "cvs", but this adds extra work at every release... Comments welcome.
Sure, sounds good. This could probably be built into the commandline library really easily. -Chris
I don't think we need a version.h file. autoconf already supports this really well. The include/Config/config.h has a #define in it named PACKAGE_VERSION which is currently defined as "[1.3]". I think we need to drop the square brackets, but other than that we could use this value in the command line library. Want me to implement it? Take about 30 minutes probably. Reid.
Using PACKAGE_VERSION is clearly the right thing to do, but how exactly do you want to implement this? Add --version options to every tool .cpp file, with code to handle it? Wouldn't it make more sense to have something like: cl::version V(PACKAGE_VERSION); Or pass it in to ParseCommandLineOptions or something? -Chris
Is supposed to be in EVERY tool, like --help, right? Why make room for the possibility that a tool implementer forgets to add the option? I think we should just make it an option within the commandline library and be done with it.
I totally agree. Go for it. What do you propose?
I propose that we stop talking about this and I just go do it. Is there some kind of big design that needs to be done? This is a no brainer, isn't it?
This is a no brainer, go for it. I just wanted to know what you were going to do. Add an option to ParseCommandLineOptions or something? Or just have CommandLine.cpp use config.h to get the info itself? -Chris
I'm just going to #include "llvm/Config/config.h" into CommandLine.cpp and implement the option directly.
Done. Commits Here: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040802/016743.html http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040802/016742.html http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040802/016744.html