Commit 1c5c009b authored by Andreas Holzammer's avatar Andreas Holzammer Committed by Tobias Hunger

add verbose messages to sdktool addQt

Change-Id: Icfcfaa01b13b1e7ed363f5cbaf7d1b43494adeb3
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent b6a4c254
......@@ -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();
}
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment