[X2Go-Commits] [x2goclient] 03/03: help.cpp: populate pretty_print: fetch max length of params.
git-admin at x2go.org
git-admin at x2go.org
Wed Apr 22 07:59:17 CEST 2015
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch bugfix/help-cmd
in repository x2goclient.
commit b8088ba8cb9cfbf48c9249b9ee0cd2b86a11b6ac
Author: Mihai Moldovan <ionic at ionic.de>
Date: Wed Apr 22 07:59:03 2015 +0200
help.cpp: populate pretty_print: fetch max length of params.
---
debian/changelog | 1 +
src/help.cpp | 11 +++++++++++
2 files changed, 12 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 926543b..987f88f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -260,6 +260,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low
- version.h: add include guard.
- help.{cpp,h}: add skeleton for new help system.
- help.{cpp,h}: add sanitizing helpers.
+ - help.cpp: populate pretty_print: fetch max length of params.
[ Fernando Pedemonte ]
* New upstream release (4.0.4.0):
diff --git a/src/help.cpp b/src/help.cpp
index 4b39a49..5201c12 100644
--- a/src/help.cpp
+++ b/src/help.cpp
@@ -18,6 +18,8 @@
***************************************************************************/
#include <QCoreApplication>
+#include <QtDebug>
+#include <cstddef>
#include "help.h"
#include "version.h"
@@ -78,5 +80,14 @@ help::data_t help::build_data () {
void help::pretty_print (help::data_t data) {
help::data_t data = help::build_data ();
+ QTextStream out << data.first.join ("\n") << "\n";
+ std::size_t max_len = 0;
+
+ /* Iterate over all parameter options and get max width. */
+ for (help::params_t::const_iterator it = data.second.constBegin (); it != data.second.constEnd (); ++it) {
+ max_len = std::max (max_len, (*it).first.length ());
+ }
+
+ std::size_t indent = 0;
}
--
Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
More information about the x2go-commits
mailing list