Show the rust type along with the Qt type in the error message

master
Jos van den Oever 2017-09-03 20:48:07 +02:00
parent d6dcc11bb9
commit 38fe6be82b
1 changed files with 6 additions and 2 deletions

View File

@ -90,9 +90,13 @@ BindingTypeProperties parseBindingType(const QString& value) {
}
QTextStream err(stderr);
err << QCoreApplication::translate("main",
"'%1' is not a supported type. Try one of\n").arg(value);
"'%1' is not a supported type. Use one of\n").arg(value);
for (auto i: bindingTypeProperties()) {
err << " " << i.name << "\n";
if (i.name == i.rustType) {
err << " " << i.rustType << "\n";
} else {
err << " " << i.name << " (" << i.rustType << ")\n";
}
}
err.flush();
exit(1);