mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 03:31:08 +00:00
[World CLI] Refactor world CLI to be easier to reason about (#2441)
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#include "../../common/json/json.h"
|
||||
#include "../../common/version.h"
|
||||
|
||||
void WorldserverCLI::Version(int argc, char **argv, argh::parser &cmd, std::string &description)
|
||||
{
|
||||
description = "Shows server version";
|
||||
|
||||
if (cmd[{"-h", "--help"}]) {
|
||||
return;
|
||||
}
|
||||
|
||||
Json::Value j;
|
||||
|
||||
j["bots_database_version"] = CURRENT_BINARY_BOTS_DATABASE_VERSION;
|
||||
j["compile_date"] = COMPILE_DATE;
|
||||
j["compile_time"] = COMPILE_TIME;
|
||||
j["database_version"] = CURRENT_BINARY_DATABASE_VERSION;
|
||||
j["server_version"] = CURRENT_VERSION;
|
||||
|
||||
std::stringstream payload;
|
||||
payload << j;
|
||||
|
||||
std::cout << payload.str() << std::endl;
|
||||
}
|
||||
Reference in New Issue
Block a user