From 1c5c009b9cb58caad065502ad8deef66bbe7710b Mon Sep 17 00:00:00 2001 From: Andreas Holzammer Date: Thu, 11 Oct 2012 14:00:24 +0200 Subject: [PATCH] add verbose messages to sdktool addQt Change-Id: Icfcfaa01b13b1e7ed363f5cbaf7d1b43494adeb3 Reviewed-by: Tobias Hunger --- src/tools/sdktool/addqtoperation.cpp | 40 +++++++++++++++++++++++----- 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 c973c82520a..ec5f6b4e2b5 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 732c7621ebb..e87022480f4 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 QListoperation->setArguments(opArgs)) { + std::cerr << "Argument parsing failed." << std::endl << std::endl; printHelp(s->operation); return -1; }