diff options
author | Christian Kamm <christian.d.kamm@nokia.com> | 2011-04-19 12:24:35 (GMT) |
---|---|---|
committer | Kai Koehne <kai.koehne@nokia.com> | 2011-05-12 09:25:51 (GMT) |
commit | 5e4d1adbbf3107c04d4238b8396e0380258cc161 (patch) | |
tree | ca1d6b0e75cfbe5e8e19034559b7d60e3ca865d4 | |
parent | eca261bd3ec4b0ff1e0f9b2220c2168e7f62a227 (diff) | |
download | Qt-5e4d1adbbf3107c04d4238b8396e0380258cc161.zip Qt-5e4d1adbbf3107c04d4238b8396e0380258cc161.tar.gz Qt-5e4d1adbbf3107c04d4238b8396e0380258cc161.tar.bz2 |
qmlplugindump: Use command line options with a single dash.
Keep the old -- options for compatibility.
Change-Id: I9c9b0beccc7043cf8b4b654bdba33946abf8c7b6
Task-number: QTBUG-18834
(cherry picked from commit 175382d834142f2a55b4e209af870ab40f741d2d)
-rw-r--r-- | tools/qmlplugindump/main.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp index 9dcdf06..848b091 100644 --- a/tools/qmlplugindump/main.cpp +++ b/tools/qmlplugindump/main.cpp @@ -413,9 +413,9 @@ void sigSegvHandler(int) { void printUsage(const QString &appName) { qWarning() << qPrintable(QString( - "Usage: %1 [--notrelocatable] module.uri version [module/import/path]\n" - " %1 --path path/to/qmldir/directory [version]\n" - " %1 --builtins\n" + "Usage: %1 [-notrelocatable] module.uri version [module/import/path]\n" + " %1 -path path/to/qmldir/directory [version]\n" + " %1 -builtins\n" "Example: %1 Qt.labs.particles 4.7 /home/user/dev/qt-install/imports").arg( appName)); } @@ -441,7 +441,10 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); const QStringList args = app.arguments(); const QString appName = QFileInfo(app.applicationFilePath()).baseName(); - if (!(args.size() >= 3 || (args.size() == 2 && args.at(1) == QLatin1String("--builtins")))) { + if (!(args.size() >= 3 + || (args.size() == 2 + && (args.at(1) == QLatin1String("--builtins") + || args.at(1) == QLatin1String("-builtins"))))) { printUsage(appName); return EXIT_INVALIDARGUMENTS; } @@ -454,14 +457,16 @@ int main(int argc, char *argv[]) if (args.size() >= 3) { QStringList positionalArgs; foreach (const QString &arg, args) { - if (!arg.startsWith("--")) { + if (!arg.startsWith(QLatin1Char('-'))) { positionalArgs.append(arg); continue; } - if (arg == QLatin1String("--notrelocatable")) { + if (arg == QLatin1String("--notrelocatable") + || arg == QLatin1String("-notrelocatable")) { relocatable = false; - } else if (arg == QLatin1String("--path")) { + } else if (arg == QLatin1String("--path") + || arg == QLatin1String("-path")) { pathImport = true; } else { qWarning() << "Invalid argument: " << arg; |