diff options
| author | Andreas Holzammer <andreas.holzammer@kdab.com> | 2012-10-11 14:00:24 +0200 |
|---|---|---|
| committer | Tobias Hunger <tobias.hunger@digia.com> | 2012-10-11 16:02:21 +0200 |
| commit | 1c5c009b9cb58caad065502ad8deef66bbe7710b (patch) | |
| tree | 9b0b7380034d819b24dbebc558852f7b34bd34fc /src/tools/sdktool | |
| parent | b6a4c254cb4c52bc7b4a9b946e74068975e06f8b (diff) | |
| download | qt-creator-1c5c009b9cb58caad065502ad8deef66bbe7710b.tar.gz | |
add verbose messages to sdktool addQt
Change-Id: Icfcfaa01b13b1e7ed363f5cbaf7d1b43494adeb3
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/tools/sdktool')
| -rw-r--r-- | src/tools/sdktool/addqtoperation.cpp | 40 | ||||
| -rw-r--r-- | src/tools/sdktool/main.cpp | 1 |
2 files changed, 35 insertions, 6 deletions
diff --git a/src/tools/sdktool/addqtoperation.cpp b/src/tools/sdktool/addqtoperation.cpp index c973c82520..ec5f6b4e2b 100644 --- a/src/tools/sdktool/addqtoperation.cpp +++ b/src/tools/sdktool/addqtoperation.cpp @@ -77,46 +77,74 @@ bool AddQtOperation::setArguments(const QStringList &args) const QString next = ((i + 1) < args.count()) ? args.at(i + 1) : QString(); if (current == QLatin1String("--id")) { - if (next.isNull()) + if (next.isNull()) { + std::cerr << "Error parsing after --id." << std::endl << std::endl; return false; + } ++i; // skip next; m_id = next; continue; } if (current == QLatin1String("--name")) { - if (next.isNull()) + if (next.isNull()) { + std::cerr << "Error parsing after --name." << std::endl << std::endl; return false; + } ++i; // skip next; m_displayName = next; continue; } if (current == QLatin1String("--qmake")) { - if (next.isNull()) + if (next.isNull()) { + std::cerr << "Error parsing after --qmake." << std::endl << std::endl; return false; + } ++i; // skip next; m_qmake = next; continue; } if (current == QLatin1String("--type")) { - if (next.isNull()) + if (next.isNull()) { + std::cerr << "Error parsing after --type." << std::endl << std::endl; return false; + } ++i; // skip next; m_type = next; continue; } - if (next.isNull()) + if (next.isNull()) { + std::cerr << "Unknown parameter: " << qPrintable(current) << std::endl << std::endl; return false; + } ++i; // skip next; KeyValuePair pair(current, next); - if (!pair.value.isValid()) + if (!pair.value.isValid()) { + std::cerr << "Error parsing: " << qPrintable(current) << " " << qPrintable(next) << std::endl << std::endl; return false; + } m_extra << pair; } + if (m_id.isEmpty()) { + std::cerr << "Error no id was passed." << std::endl << std::endl; + } + + if (m_displayName.isEmpty()) { + std::cerr << "Error no display name was passed." << std::endl << std::endl; + } + + if (m_qmake.isEmpty()) { + std::cerr << "Error no qmake was passed." << std::endl << std::endl; + } + + if (m_type.isEmpty()) { + std::cerr << "Error no type was passed." << std::endl << std::endl; + } + return !m_id.isEmpty() && !m_displayName.isEmpty() && !m_qmake.isEmpty() && !m_type.isEmpty(); } diff --git a/src/tools/sdktool/main.cpp b/src/tools/sdktool/main.cpp index 732c7621eb..e87022480f 100644 --- a/src/tools/sdktool/main.cpp +++ b/src/tools/sdktool/main.cpp @@ -139,6 +139,7 @@ int parseArguments(const QStringList &args, Settings *s, const QList<Operation * return -1; } if (!s->operation->setArguments(opArgs)) { + std::cerr << "Argument parsing failed." << std::endl << std::endl; printHelp(s->operation); return -1; } |
