SDKtool: Fix return values and improve error reporting

Change-Id: I1a44a39d5cd96be48608fdb4fab252a51046971e
Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
Tobias Hunger
2013-02-07 10:42:24 +01:00
parent c8a34f05a0
commit 56582e8c06
11 changed files with 90 additions and 33 deletions

View File

@@ -57,11 +57,18 @@ bool FindValueOperation::setArguments(const QStringList &args)
}
QVariant v = Operation::valueFromString(current);
if (!v.isValid())
if (!v.isValid()) {
std::cerr << "Value for key '" << qPrintable(current) << "' is not valid." << std::endl << std::endl;
return false;
}
m_values << v;
}
if (m_file.isEmpty())
std::cerr << "No file given." << std::endl << std::endl;
if (m_values.isEmpty())
std::cerr << "No values given." << std::endl << std::endl;
return (!m_file.isEmpty() && !m_values.isEmpty());
}