1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-14 17:15:21 +02:00

Show supported backends in --help output (#16441)

This commit is contained in:
sfan5
2025-08-25 21:36:25 +02:00
committed by GitHub
parent 04d9bd518f
commit 3f0f7f4285
7 changed files with 113 additions and 17 deletions

View File

@@ -2,6 +2,9 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
// Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
#include <map>
#include <algorithm>
#include "irrlichttypes_bloated.h"
#include "irrlicht.h" // createDevice
#include "irrlicht_changes/printing.h"
@@ -405,6 +408,22 @@ static void print_help(const OptionList &allowed_options)
{
std::cout << _("Allowed options:") << std::endl;
print_allowed_options(allowed_options);
std::cout << std::endl;
std::pair<const char*, std::vector<std::string>> the_list[] = {
{"map", ServerMap::getDatabaseBackends()},
{"players", ServerEnvironment::getPlayerDatabaseBackends()},
{"auth", ServerEnvironment::getAuthDatabaseBackends()},
{"mod storage", Server::getModStorageDatabaseBackends()},
};
std::cout << "Supported database backends:";
for (auto &e : the_list) {
SORT_AND_UNIQUE(e.second);
std::cout << "\n " << padStringRight(e.first, 16)
<< ": " << str_join(e.second, ", ");
}
std::cout << std::endl;
}
static void print_allowed_options(const OptionList &allowed_options)