forked from Mirrorlandia_minetest/minetest
Break long lines of option help (#13136)
This commit is contained in:
parent
ab1fe80150
commit
956026bb6b
10
src/main.cpp
10
src/main.cpp
@ -389,12 +389,14 @@ static void print_help(const OptionList &allowed_options)
|
||||
static void print_allowed_options(const OptionList &allowed_options)
|
||||
{
|
||||
for (const auto &allowed_option : allowed_options) {
|
||||
std::ostringstream os1(std::ios::binary);
|
||||
os1 << " --" << allowed_option.first;
|
||||
std::string opt = " --" + allowed_option.first;
|
||||
if (allowed_option.second.type != VALUETYPE_FLAG)
|
||||
os1 << _(" <value>");
|
||||
opt += _(" <value>");
|
||||
|
||||
std::cout << padStringRight(os1.str(), 30);
|
||||
std::string opt_padded = padStringRight(opt, 30);
|
||||
std::cout << opt_padded;
|
||||
if (opt == opt_padded) // Line is too long to pad
|
||||
std::cout << std::endl << padStringRight("", 30);
|
||||
|
||||
if (allowed_option.second.help)
|
||||
std::cout << allowed_option.second.help;
|
||||
|
Loading…
Reference in New Issue
Block a user