summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-01-10 20:17:55 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2011-01-25 08:32:20 -0300
commitb3daa9b6f33fe0925d0983b7dc84add876abc36a (patch)
tree5b6ba039f74890dac53e087e6ec795df862a6416
parent36c7cb03f442deb4d76a94e35cd11d49a3586884 (diff)
Renamed "generatorSet" command line option to "generator-set".
Now the option name is similar to all the other command line options. Yet, to assure backward compatibility, the "generatorSet" parameter is still accepted, although it will not override the "generator-set" option.
-rw-r--r--generators/qtdoc/main.cpp2
-rw-r--r--main.cpp13
2 files changed, 10 insertions, 5 deletions
diff --git a/generators/qtdoc/main.cpp b/generators/qtdoc/main.cpp
index 76d695bf..21fab147 100644
--- a/generators/qtdoc/main.cpp
+++ b/generators/qtdoc/main.cpp
@@ -26,7 +26,7 @@
int main(int argc, char *argv[])
{
QStringList args;
- args.append("--generatorSet=qtdoc");
+ args.append("--generator-set=qtdoc");
for (int i = 1; i < argc; i++)
args.append(argv[i]);
return QProcess::execute("generatorrunner", args);
diff --git a/main.cpp b/main.cpp
index dfa79e8e..88e4eabd 100644
--- a/main.cpp
+++ b/main.cpp
@@ -87,9 +87,9 @@ void printUsage(const GeneratorList& generators)
generalOptions.insert("include-paths=<path>[" PATH_SPLITTER "<path>" PATH_SPLITTER "...]", "Include paths used by the C++ parser");
generalOptions.insert("typesystem-paths=<path>[" PATH_SPLITTER "<path>" PATH_SPLITTER "...]", "Paths used when searching for typesystems");
generalOptions.insert("documentation-only", "Do not generates any code, just the documentation");
- generalOptions.insert("license-file=[licensefile]", "File used for copyright headers of generated files");
+ generalOptions.insert("license-file=[license-file]", "File used for copyright headers of generated files");
generalOptions.insert("version", "Output version information and exit");
- generalOptions.insert("generatorSet", "generatorSet to be used. e.g. qtdoc");
+ generalOptions.insert("generator-set", "generator-set to be used. e.g. qtdoc");
generalOptions.insert("api-version", "Specify the supported api version used to generate the bindings");
printOptions(s, generalOptions);
@@ -118,7 +118,12 @@ int main(int argc, char *argv[])
}
// Try to load a generator
- QString generatorSet = args.value("generatorSet");
+ QString generatorSet = args.value("generator-set");
+
+ // Also check "generatorSet" command line argument for backward compatibility.
+ if (generatorSet.isEmpty())
+ generatorSet = args.value("generatorSet");
+
if (!generatorSet.isEmpty()) {
QFileInfo generatorFile(generatorSet);
@@ -134,7 +139,7 @@ int main(int argc, char *argv[])
return EXIT_FAILURE;
}
} else if (!args.contains("help")) {
- std::cerr << argv[0] << ": You need to specify a generator with --generatorSet=GENERATOR_NAME" << std::endl;
+ std::cerr << argv[0] << ": You need to specify a generator with --generator-set=GENERATOR_NAME" << std::endl;
return EXIT_FAILURE;
}