fix(SERVER/Main): Implementation for version param (#22707)
This commit is contained in:
@@ -29,6 +29,7 @@
|
|||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "DatabaseEnv.h"
|
#include "DatabaseEnv.h"
|
||||||
#include "DatabaseLoader.h"
|
#include "DatabaseLoader.h"
|
||||||
|
#include "GitRevision.h"
|
||||||
#include "IPLocation.h"
|
#include "IPLocation.h"
|
||||||
#include "IoContext.h"
|
#include "IoContext.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
@@ -75,7 +76,7 @@ int main(int argc, char** argv)
|
|||||||
auto vm = GetConsoleArguments(argc, argv, configFile);
|
auto vm = GetConsoleArguments(argc, argv, configFile);
|
||||||
|
|
||||||
// exit if help or version is enabled
|
// exit if help or version is enabled
|
||||||
if (vm.count("help"))
|
if (vm.count("help") || vm.count("version"))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Add file and args in config
|
// Add file and args in config
|
||||||
@@ -292,13 +293,11 @@ variables_map GetConsoleArguments(int argc, char** argv, fs::path& configFile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (variablesMap.count("help"))
|
if (variablesMap.count("help"))
|
||||||
{
|
|
||||||
std::cout << all << "\n";
|
std::cout << all << "\n";
|
||||||
}
|
else if (variablesMap.count("version"))
|
||||||
|
std::cout << GitRevision::GetFullVersion() << "\n";
|
||||||
else if (variablesMap.count("dry-run"))
|
else if (variablesMap.count("dry-run"))
|
||||||
{
|
|
||||||
sConfigMgr->setDryRun(true);
|
sConfigMgr->setDryRun(true);
|
||||||
}
|
|
||||||
|
|
||||||
return variablesMap;
|
return variablesMap;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ int main(int argc, char** argv)
|
|||||||
auto vm = GetConsoleArguments(argc, argv, configFile, configService);
|
auto vm = GetConsoleArguments(argc, argv, configFile, configService);
|
||||||
|
|
||||||
// exit if help or version is enabled
|
// exit if help or version is enabled
|
||||||
if (vm.count("help"))
|
if (vm.count("help") || vm.count("version"))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#if AC_PLATFORM == AC_PLATFORM_WINDOWS
|
#if AC_PLATFORM == AC_PLATFORM_WINDOWS
|
||||||
@@ -733,13 +733,11 @@ variables_map GetConsoleArguments(int argc, char** argv, fs::path& configFile, [
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (vm.count("help"))
|
if (vm.count("help"))
|
||||||
{
|
|
||||||
std::cout << all << "\n";
|
std::cout << all << "\n";
|
||||||
}
|
else if (vm.count("version"))
|
||||||
|
std::cout << GitRevision::GetFullVersion() << "\n";
|
||||||
else if (vm.count("dry-run"))
|
else if (vm.count("dry-run"))
|
||||||
{
|
|
||||||
sConfigMgr->setDryRun(true);
|
sConfigMgr->setDryRun(true);
|
||||||
}
|
|
||||||
|
|
||||||
return vm;
|
return vm;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user