[cli] Warn user if specified device id doesn't exist

This commit is contained in:
Nicolas Fella 2019-09-10 16:09:06 +00:00
parent 01fa989786
commit c8c82e01a7

View file

@ -183,6 +183,11 @@ int main(int argc, char** argv)
parser.showHelp(1);
}
if (!blockOnReply<QStringList>(iface.devices(false, false)).contains(device)) {
QTextStream(stderr) << "Couldn't find device with id \"" << device << "\". To specify a device by name use -n <devicename>" << endl;
return 1;
}
if (parser.isSet(QStringLiteral("share"))) {
QStringList urls;