aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2013-09-25 04:47:44 +0200
committerKahrl <kahrl@gmx.net>2013-09-28 21:30:17 +0200
commit5dce44ec5e5f7231dba3cdbec3f1fdc683ce5a34 (patch)
treed6c709c890ce78a611a42cfc8af730c18e22dfec /src
parentf0edd88dff26f408db895046b9411248ff3d51dd (diff)
downloadminetest-5dce44ec5e5f7231dba3cdbec3f1fdc683ce5a34.tar.gz
minetest-5dce44ec5e5f7231dba3cdbec3f1fdc683ce5a34.tar.bz2
minetest-5dce44ec5e5f7231dba3cdbec3f1fdc683ce5a34.zip
Add --version option
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 10547b711..455138d5b 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -772,6 +772,8 @@ int main(int argc, char *argv[])
std::map<std::string, ValueSpec> allowed_options;
allowed_options.insert(std::make_pair("help", ValueSpec(VALUETYPE_FLAG,
_("Show allowed options"))));
+ allowed_options.insert(std::make_pair("version", ValueSpec(VALUETYPE_FLAG,
+ _("Show version information"))));
allowed_options.insert(std::make_pair("config", ValueSpec(VALUETYPE_STRING,
_("Load configuration from specified file"))));
allowed_options.insert(std::make_pair("port", ValueSpec(VALUETYPE_STRING,
@@ -843,6 +845,18 @@ int main(int argc, char *argv[])
return cmd_args.getFlag("help") ? 0 : 1;
}
+
+ if(cmd_args.getFlag("version"))
+ {
+#ifdef SERVER
+ dstream<<"minetestserver "<<minetest_version_hash<<std::endl;
+#else
+ dstream<<"Minetest "<<minetest_version_hash<<std::endl;
+ dstream<<"Using Irrlicht "<<IRRLICHT_SDK_VERSION<<std::endl;
+#endif
+ dstream<<"Build info: "<<minetest_build_info<<std::endl;
+ return 0;
+ }
/*
Low-level initialization