summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2018-08-05 00:10:39 +0800
committerJohn Hodge <tpg@ucc.asn.au>2018-08-05 00:10:39 +0800
commitec907f56199c495db061f2712a5be3977bcb11e8 (patch)
tree57ad89f8b82cfd23434bd2622a15ee6d0afe4a30 /src/main.cpp
parentb5df909cdc61a10d750e2d9cb8ba11f4bdec6609 (diff)
downloadmrust-ec907f56199c495db061f2712a5be3977bcb11e8.tar.gz
Add version number (0.8 for now, because altough not stable, it works...)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 8f2740fc..0e37f4a3 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -9,6 +9,7 @@
#include <iomanip>
#include <string>
#include <set>
+#include <version.hpp>
#include <string_view.hpp>
#include "parse/lex.hpp"
#include "parse/parseerror.hpp"
@@ -944,6 +945,12 @@ ProgramParams::ProgramParams(int argc, char *argv[])
this->show_help();
exit(0);
}
+ else if( strcmp(arg, "--version" ) == 0 ) {
+ ::std::cout << "MRustC " << Version_GetString() << ::std::endl;
+ ::std::cout << "- Build time: " << gsVersion_BuildTime << ::std::endl;
+ ::std::cout << "- Commit: " << gsVersion_GitHash << (gbVersion_GitDirty ? " (dirty tree)" : "") << ::std::endl;
+ exit(0);
+ }
// --out-dir <dir> >> Set the output directory for automatically-named files
else if( strcmp(arg, "--out-dir") == 0) {
if (i == argc - 1) {