Commit 9d503bc8 authored by Matthijs Tijink's avatar Matthijs Tijink Committed by Nicolas Fella
Browse files

Fix passing multiple attachments to the CLI

Also updated the related zsh autocompletion.
parent 06d81412
Pipeline #39118 passed with stage
in 5 minutes and 56 seconds
......@@ -53,7 +53,7 @@ int main(int argc, char** argv)
parser.addOption(QCommandLineOption(QStringLiteral("lock"), i18n("Lock the specified device")));
parser.addOption(QCommandLineOption(QStringLiteral("send-sms"), i18n("Sends an SMS. Requires destination"), i18n("message")));
parser.addOption(QCommandLineOption(QStringLiteral("destination"), i18n("Phone number to send the message"), i18n("phone number")));
parser.addOption(QCommandLineOption(QStringLiteral("attachment"), i18n("File urls to send attachments with the message"), i18n("file urls")));
parser.addOption(QCommandLineOption(QStringLiteral("attachment"), i18n("File urls to send attachments with the message (can be passed multiple times)"), i18n("file urls")));
parser.addOption(QCommandLineOption(QStringList(QStringLiteral("device")) << QStringLiteral("d"), i18n("Device ID"), QStringLiteral("dev")));
parser.addOption(QCommandLineOption(QStringList(QStringLiteral("name")) << QStringLiteral("n"), i18n("Device Name"), QStringLiteral("name")));
parser.addOption(QCommandLineOption(QStringLiteral("encryption-info"), i18n("Get encryption info about said device")));
......@@ -261,7 +261,7 @@ int main(int argc, char** argv)
const QString message = parser.value(QStringLiteral("send-sms"));
const QStringList rawAttachmentUrlsList = parser.value(QStringLiteral("attachment")).split(QRegularExpression(QStringLiteral("\\s+")));
const QStringList rawAttachmentUrlsList = parser.values(QStringLiteral("attachment"));
QVariantList attachments;
for (const QString& attachmentUrl : rawAttachmentUrlsList) {
......
......@@ -44,4 +44,5 @@ _arguments -s \
$blockoperations"--photo=[open the connected device's camera and transfer the photo]:file:_files" \
+ 'sms' \
'(operation)--send-sms=[send an SMS]:message:' \
'(operation)--destination=[specify phone number to send the SMS to]:phone number:'
'(operation)--destination=[specify phone number to send the SMS to]:phone number:' \
'(operation)*--attachment=[attachment to send with the message]:file:_files'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment