forked from qt-creator/qt-creator
add verbose messages to sdktool addQt
Change-Id: Icfcfaa01b13b1e7ed363f5cbaf7d1b43494adeb3 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Tobias Hunger
parent
b6a4c254cb
commit
1c5c009b9c
@@ -77,46 +77,74 @@ bool AddQtOperation::setArguments(const QStringList &args)
|
|||||||
const QString next = ((i + 1) < args.count()) ? args.at(i + 1) : QString();
|
const QString next = ((i + 1) < args.count()) ? args.at(i + 1) : QString();
|
||||||
|
|
||||||
if (current == QLatin1String("--id")) {
|
if (current == QLatin1String("--id")) {
|
||||||
if (next.isNull())
|
if (next.isNull()) {
|
||||||
|
std::cerr << "Error parsing after --id." << std::endl << std::endl;
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
++i; // skip next;
|
++i; // skip next;
|
||||||
m_id = next;
|
m_id = next;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current == QLatin1String("--name")) {
|
if (current == QLatin1String("--name")) {
|
||||||
if (next.isNull())
|
if (next.isNull()) {
|
||||||
|
std::cerr << "Error parsing after --name." << std::endl << std::endl;
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
++i; // skip next;
|
++i; // skip next;
|
||||||
m_displayName = next;
|
m_displayName = next;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current == QLatin1String("--qmake")) {
|
if (current == QLatin1String("--qmake")) {
|
||||||
if (next.isNull())
|
if (next.isNull()) {
|
||||||
|
std::cerr << "Error parsing after --qmake." << std::endl << std::endl;
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
++i; // skip next;
|
++i; // skip next;
|
||||||
m_qmake = next;
|
m_qmake = next;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current == QLatin1String("--type")) {
|
if (current == QLatin1String("--type")) {
|
||||||
if (next.isNull())
|
if (next.isNull()) {
|
||||||
|
std::cerr << "Error parsing after --type." << std::endl << std::endl;
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
++i; // skip next;
|
++i; // skip next;
|
||||||
m_type = next;
|
m_type = next;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (next.isNull())
|
if (next.isNull()) {
|
||||||
|
std::cerr << "Unknown parameter: " << qPrintable(current) << std::endl << std::endl;
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
++i; // skip next;
|
++i; // skip next;
|
||||||
KeyValuePair pair(current, 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;
|
return false;
|
||||||
|
}
|
||||||
m_extra << pair;
|
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();
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
if (!s->operation->setArguments(opArgs)) {
|
if (!s->operation->setArguments(opArgs)) {
|
||||||
|
std::cerr << "Argument parsing failed." << std::endl << std::endl;
|
||||||
printHelp(s->operation);
|
printHelp(s->operation);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user