Core/Executables: Add --version and -v to worldserver and authserver arguments
Closes #14993 (cherry picked from commit 0f082e8f925f17e585fd221b901f55581d2d68ab) Conflicts: src/server/bnetserver/Main.cpp
This commit is contained in:
1 parent
5e9a21291c
commit
be32beee57
2 files changed
+12
-4
No files matched your search
@@ -79,8 +79,8 @@ int main(int argc, char** argv)
|
||||
std::string configFile = _TRINITY_REALM_CONFIG;
|
||||
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;
|
||||
|
||||
#if PLATFORM == PLATFORM_WINDOWS
|
||||
@@ -262,6 +262,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_REALM_CONFIG), "use <arg> as configuration file")
|
||||
;
|
||||
#if PLATFORM == PLATFORM_WINDOWS
|
||||
@@ -287,6 +288,8 @@ variables_map GetConsoleArguments(int argc, char** argv, std::string& configFile
|
||||
|
||||
if (variablesMap.count("help"))
|
||||
std::cout << all << "\n";
|
||||
else if (variablesMap.count("version"))
|
||||
std::cout << _FULLVERSION << "\n";
|
||||
|
||||
return variablesMap;
|
||||
}
|
||||
Reference in new issue
Block a user