summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-03-11 11:02:22 +0200
committerPerttu Ahola <celeron55@gmail.com>2012-03-11 11:02:22 +0200
commitd330430336404960784ef513ffedde2dd57d7538 (patch)
treeb4bf38afbf37dbacb5948ae9dd7826bf60906d28 /src/main.cpp
parent37b2bc3c0cb099e0a4c3b48db46c3ad8736eee04 (diff)
downloadminetest-d330430336404960784ef513ffedde2dd57d7538.tar.gz
minetest-d330430336404960784ef513ffedde2dd57d7538.tar.bz2
minetest-d330430336404960784ef513ffedde2dd57d7538.zip
Prettify --help output
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 0c936ab63..bd987f723 100644
--- a/src/main.cpp
+++ b/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;