CLI improvements for Qt 5.14+
Qt 5.14 adds a "--help-all" option, so include it in the autocompletion. Qt 5.14 also warns on multiple additions of the same option, which we accidently did (KAboutData and we ourselves called it), so don't do that. Also fixes device autocompletion, which I accidently broke.
This commit is contained in:
parent
b61cf6b28c
commit
c6f83e5c16
2 changed files with 2 additions and 2 deletions
|
@ -83,7 +83,6 @@ int main(int argc, char** argv)
|
||||||
parser.addOption(deviceAutocomplete);
|
parser.addOption(deviceAutocomplete);
|
||||||
about.setupCommandLine(&parser);
|
about.setupCommandLine(&parser);
|
||||||
|
|
||||||
parser.addHelpOption();
|
|
||||||
parser.process(app);
|
parser.process(app);
|
||||||
about.processCommandLine(&parser);
|
about.processCommandLine(&parser);
|
||||||
|
|
||||||
|
@ -167,7 +166,7 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Exit with 1 if we didn't find a device
|
//Exit with 1 if we didn't find a device
|
||||||
return int(!devices.isEmpty());
|
return int(devices.isEmpty());
|
||||||
} else if(parser.isSet(QStringLiteral("refresh"))) {
|
} else if(parser.isSet(QStringLiteral("refresh"))) {
|
||||||
QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kdeconnect"), QStringLiteral("/modules/kdeconnect"), QStringLiteral("org.kde.kdeconnect.daemon"), QStringLiteral("forceOnNetworkChange"));
|
QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kdeconnect"), QStringLiteral("/modules/kdeconnect"), QStringLiteral("org.kde.kdeconnect.daemon"), QStringLiteral("forceOnNetworkChange"));
|
||||||
blockOnReply(DBusHelper::sessionBus().asyncCall(msg));
|
blockOnReply(DBusHelper::sessionBus().asyncCall(msg));
|
||||||
|
|
|
@ -17,6 +17,7 @@ _kdeconnect_device-ids() {
|
||||||
local blockoperations="(operation sms)"
|
local blockoperations="(operation sms)"
|
||||||
_arguments -s \
|
_arguments -s \
|
||||||
'(-)'{-h,--help}'[display usage information]' \
|
'(-)'{-h,--help}'[display usage information]' \
|
||||||
|
'(-)--help-all[display usage information, including Qt specific options]' \
|
||||||
+ '(global)' \
|
+ '(global)' \
|
||||||
$blockoperations{-l,--list-devices}'[list all devices]' \
|
$blockoperations{-l,--list-devices}'[list all devices]' \
|
||||||
$blockoperations{-a,--list-available}'[list available (paired and reachable) devices]' \
|
$blockoperations{-a,--list-available}'[list available (paired and reachable) devices]' \
|
||||||
|
|
Loading…
Reference in a new issue