mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
Core/Executables: Add --version and -v to worldserver and authserver arguments
Closes #14993
(cherry picked from commit 0f082e8f92)
Conflicts:
src/server/bnetserver/Main.cpp
This commit is contained in:
@@ -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