mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Prettify --help output
This commit is contained in:
parent
37b2bc3c0c
commit
d330430336
3 changed files with 44 additions and 18 deletions
19
src/main.cpp
19
src/main.cpp
|
@ -68,6 +68,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "profiler.h"
|
||||
#include "log.h"
|
||||
#include "mods.h"
|
||||
#include "utility_string.h"
|
||||
|
||||
/*
|
||||
Settings.
|
||||
|
@ -798,21 +799,17 @@ int main(int argc, char *argv[])
|
|||
i = allowed_options.getIterator();
|
||||
i.atEnd() == false; i++)
|
||||
{
|
||||
dstream<<" --"<<i.getNode()->getKey();
|
||||
std::ostringstream os1(std::ios::binary);
|
||||
os1<<" --"<<i.getNode()->getKey();
|
||||
if(i.getNode()->getValue().type == VALUETYPE_FLAG)
|
||||
{
|
||||
}
|
||||
{}
|
||||
else
|
||||
{
|
||||
dstream<<" <value>";
|
||||
}
|
||||
dstream<<std::endl;
|
||||
os1<<" <value>";
|
||||
dstream<<padStringRight(os1.str(), 24);
|
||||
|
||||
if(i.getNode()->getValue().help != NULL)
|
||||
{
|
||||
dstream<<" "<<i.getNode()->getValue().help
|
||||
<<std::endl;
|
||||
}
|
||||
dstream<<i.getNode()->getValue().help;
|
||||
dstream<<std::endl;
|
||||
}
|
||||
|
||||
return cmd_args.getFlag("help") ? 0 : 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue