aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-04-04 15:13:54 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-04-19 06:16:47 +0000
commit7a41c195298af2ce4e47c267b5b64039cd890833 (patch)
tree5126c7c99a6e87f7d5514219a153c6d881f98bbc /sources/shiboken2
parent5c3f6e3e50de4c41ded289111cd1e78fd9ec369b (diff)
shiboken: Reformat help
Print option descriptions indented by 8 below the option instead of beside the option at column 38 and add some newlines to avoid wrapping. Change-Id: I63295a40aaac588f761c5964b68dbaff8d013c95 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2')
-rw-r--r--sources/shiboken2/generator/main.cpp23
-rw-r--r--sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp5
-rw-r--r--sources/shiboken2/generator/shiboken2/shibokengenerator.cpp12
3 files changed, 26 insertions, 14 deletions
diff --git a/sources/shiboken2/generator/main.cpp b/sources/shiboken2/generator/main.cpp
index 774775fb0..b787d9f7e 100644
--- a/sources/shiboken2/generator/main.cpp
+++ b/sources/shiboken2/generator/main.cpp
@@ -146,13 +146,18 @@ static void printOptions(QTextStream& s, const OptionDescriptions& options)
{
s.setFieldAlignment(QTextStream::AlignLeft);
for (const auto &od : options) {
- s << ' ';
if (!od.first.startsWith(QLatin1Char('-')))
s << "--";
- s.setFieldWidth(38);
- s << od.first << od.second;
- s.setFieldWidth(0);
- s << endl;
+ s << od.first;
+ if (od.second.isEmpty()) {
+ s << ", ";
+ } else {
+ s << endl;
+ const auto lines = od.second.splitRef(QLatin1Char('\n'));
+ for (const auto &line : lines)
+ s << " " << line << endl;
+ s << endl;
+ }
}
}
@@ -348,7 +353,8 @@ void printUsage()
<< qMakePair(QLatin1String("documentation-only"),
QLatin1String("Do not generates any code, just the documentation"))
<< qMakePair(QLatin1String("drop-type-entries=\"<TypeEntry0>[;TypeEntry1;...]\""),
- QLatin1String("Semicolon separated list of type system entries (classes, namespaces, global functions and enums) to be dropped from generation."))
+ QLatin1String("Semicolon separated list of type system entries (classes, namespaces,\n"
+ "global functions and enums) to be dropped from generation."))
<< qMakePair(QLatin1String("-F") + pathSyntax, QString())
<< qMakePair(QLatin1String("framework-include-paths=") + pathSyntax,
QLatin1String("Framework include paths used by the C++ parser"))
@@ -367,7 +373,8 @@ void printUsage()
<< qMakePair(QLatin1String("output-directory=<path>"),
QLatin1String("The directory where the generated files will be written"))
<< qMakePair(QLatin1String("project-file=<file>"),
- QLatin1String("text file containing a description of the binding project. Replaces and overrides command line arguments"))
+ QLatin1String("text file containing a description of the binding project.\n"
+ "Replaces and overrides command line arguments"))
<< qMakePair(QLatin1String("silent"),
QLatin1String("Avoid printing any message"))
<< qMakePair(QLatin1String("-T") + pathSyntax, QString())
@@ -381,7 +388,7 @@ void printUsage()
for (const GeneratorPtr &generator : generators) {
const OptionDescriptions options = generator->options();
if (!options.isEmpty()) {
- s << endl << generator->name() << " options:\n";
+ s << endl << generator->name() << " options:\n\n";
printOptions(s, generator->options());
}
}
diff --git a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
index 842c68b90..11e66d0cc 100644
--- a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
+++ b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
@@ -1996,11 +1996,12 @@ Generator::OptionDescriptions QtDocGenerator::options() const
{
return OptionDescriptions()
<< qMakePair(QLatin1String("doc-parser"),
- QLatin1String("The documentation parser used to interpret the documentation input files (qdoc3|doxygen)"))
+ QLatin1String("The documentation parser used to interpret the documentation\n"
+ "input files (qdoc|doxygen)"))
<< qMakePair(QLatin1String("documentation-code-snippets-dir"),
QLatin1String("Directory used to search code snippets used by the documentation"))
<< qMakePair(QLatin1String("documentation-data-dir"),
- QLatin1String("Directory with XML files generated by documentation tool (qdoc3 or Doxygen)"))
+ QLatin1String("Directory with XML files generated by documentation tool"))
<< qMakePair(QLatin1String("documentation-extra-sections-dir"),
QLatin1String("Directory used to search for extra documentation sections"))
<< qMakePair(QLatin1String("library-source-dir"),
diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
index d64719bb8..bb8f95617 100644
--- a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
@@ -2513,15 +2513,19 @@ Generator::OptionDescriptions ShibokenGenerator::options() const
<< qMakePair(QLatin1String(AVOID_PROTECTED_HACK),
QLatin1String("Avoid the use of the '#define protected public' hack."))
<< qMakePair(QLatin1String(DISABLE_VERBOSE_ERROR_MESSAGES),
- QLatin1String("Disable verbose error messages. Turn the python code hard to debug but safe few kB on the generated bindings."))
+ QLatin1String("Disable verbose error messages. Turn the python code hard to debug\n"
+ "but safe few kB on the generated bindings."))
<< qMakePair(QLatin1String(PARENT_CTOR_HEURISTIC),
QLatin1String("Enable heuristics to detect parent relationship on constructors."))
<< qMakePair(QLatin1String(ENABLE_PYSIDE_EXTENSIONS),
- QLatin1String("Enable PySide extensions, such as support for signal/slots, use this if you are creating a binding for a Qt-based library."))
+ QLatin1String("Enable PySide extensions, such as support for signal/slots,\n"
+ "use this if you are creating a binding for a Qt-based library."))
<< qMakePair(QLatin1String(RETURN_VALUE_HEURISTIC),
- QLatin1String("Enable heuristics to detect parent relationship on return values (USE WITH CAUTION!)"))
+ QLatin1String("Enable heuristics to detect parent relationship on return values\n"
+ "(USE WITH CAUTION!)"))
<< qMakePair(QLatin1String(USE_ISNULL_AS_NB_NONZERO),
- QLatin1String("If a class have an isNull()const method, it will be used to compute the value of boolean casts"));
+ QLatin1String("If a class have an isNull() const method, it will be used to compute\n"
+ "the value of boolean casts"));
}
static void getCode(QStringList& code, const CodeSnipList& codeSnips)