diff options
author | DDuarte <dnpd.dd@gmail.com> | 2015-07-04 02:54:23 +0100 |
---|---|---|
committer | DDuarte <dnpd.dd@gmail.com> | 2015-07-04 02:54:23 +0100 |
commit | be32beee57f8eaf6445d429ec1147377115a1092 (patch) | |
tree | c65e5ce69ab779b716566d7279a4373acea7bc49 /src/server/worldserver/Main.cpp | |
parent | 5e9a21291cc6d1bdcdb65b761fbed905a214524d (diff) |
Core/Executables: Add --version and -v to worldserver and authserver arguments
Closes #14993
(cherry picked from commit 0f082e8f925f17e585fd221b901f55581d2d68ab)
Conflicts:
src/server/bnetserver/Main.cpp
Diffstat (limited to 'src/server/worldserver/Main.cpp')
-rw-r--r-- | src/server/worldserver/Main.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp index 430c3ce4d73..b3d97d7884c 100644 --- a/src/server/worldserver/Main.cpp +++ b/src/server/worldserver/Main.cpp @@ -100,8 +100,8 @@ extern int main(int argc, char** argv) std::string configService; auto vm = GetConsoleArguments(argc, argv, configFile, configService); - // exit if help is enabled - if (vm.count("help")) + // exit if help or version is enabled + if (vm.count("help") || vm.count("version")) return 0; #ifdef _WIN32 @@ -511,6 +511,7 @@ variables_map GetConsoleArguments(int argc, char** argv, std::string& configFile options_description all("Allowed options"); all.add_options() ("help,h", "print usage message") + ("version,v", "print version build info") ("config,c", value<std::string>(&configFile)->default_value(_TRINITY_CORE_CONFIG), "use <arg> as configuration file") ; #ifdef _WIN32 @@ -534,6 +535,10 @@ variables_map GetConsoleArguments(int argc, char** argv, std::string& configFile if (vm.count("help")) { std::cout << all << "\n"; } + else if (vm.count("version")) + { + std::cout << _FULLVERSION << "\n"; + } return vm; } |