mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-30 19:22:14 +00:00
Show supported backends in --help output (#16441)
This commit is contained in:
parent
04d9bd518f
commit
3f0f7f4285
7 changed files with 113 additions and 17 deletions
19
src/main.cpp
19
src/main.cpp
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue