aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorPaulo Alcantara <pcacjr@gmail.com>2012-01-05 16:37:13 -0300
committerPaulo Alcantara <pcacjr@gmail.com>2012-01-05 17:06:19 -0300
commitdc67bd50c36b0c875c259ca4e623d036920df1fe (patch)
treee03fcb21d5612bddb8964afb9b2b8cee7be18de4 /main.cpp
parentbfffaa4ef8cba22ac30dd5aa597e8df1d6eda971 (diff)
Fix BUG #1092 - "shiboken names itself a 'generator'"
See http://bugs.pyside.org/show_bug.cgi?id=1092. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com> Reviewed-by: Marcelo Lira <marcelo.lira@openbossa.org> Reviewed-by: Hugo Parente Lima <hugo.pl@gmail.com>
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/main.cpp b/main.cpp
index c70633d6e..1804aac9f 100644
--- a/main.cpp
+++ b/main.cpp
@@ -165,12 +165,13 @@ static QMap<QString, QString> getCommandLineArgs()
return args;
}
-void printUsage(const GeneratorList& generators)
+void printUsage(const GeneratorList& generators, const QString& generatorName)
{
QTextStream s(stdout);
s << "Usage:\n "
- << "generator [options] header-file typesystem-file\n\n"
- "General options:\n";
+ << (generatorName.isEmpty() ? "generator" : generatorName)
+ << " [options] header-file typesystem-file\n\n"
+ << "General options:\n";
QMap<QString, QString> generalOptions;
generalOptions.insert("project-file=<file>", "text file containing a description of the binding project. Replaces and overrides command line arguments");
generalOptions.insert("debug-level=[sparse|medium|full]", "Set the debug level");
@@ -221,7 +222,6 @@ int main(int argc, char *argv[])
if (!generatorSet.isEmpty()) {
QFileInfo generatorFile(generatorSet);
-
if (!generatorFile.exists()) {
QString generatorSetName(generatorSet + "_generator" + MODULE_EXTENSION);
@@ -253,12 +253,17 @@ int main(int argc, char *argv[])
return EXIT_FAILURE;
}
+ /* We need alias-name argument for the usage's message being
+ * printed properly when running Generatorrunner from a Shiboken's
+ * process. Don't worry, this "new method of doing IPC between two
+ * processes" is only used here as a workaround, and not our way
+ * out to do IPC. :-)
+ */
if (args.contains("help")) {
- printUsage(generators);
+ printUsage(generators, args.value("alias-name"));
return EXIT_SUCCESS;
}
-
QString licenseComment;
if (args.contains("license-file") && !args.value("license-file").isEmpty()) {
QString licenseFileName = args.value("license-file");