From c8c82e01a748f6da9dc1231c7735ca1239aa157f Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Tue, 10 Sep 2019 16:09:06 +0000 Subject: [PATCH] [cli] Warn user if specified device id doesn't exist --- cli/kdeconnect-cli.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cli/kdeconnect-cli.cpp b/cli/kdeconnect-cli.cpp index fa9bf1090..517700280 100644 --- a/cli/kdeconnect-cli.cpp +++ b/cli/kdeconnect-cli.cpp @@ -183,6 +183,11 @@ int main(int argc, char** argv) parser.showHelp(1); } + if (!blockOnReply(iface.devices(false, false)).contains(device)) { + QTextStream(stderr) << "Couldn't find device with id \"" << device << "\". To specify a device by name use -n " << endl; + return 1; + } + if (parser.isSet(QStringLiteral("share"))) { QStringList urls;