Skip to content

Commit 3cc1c81

Browse files
authored
Merge pull request #314 from nextcloud/feature/noid/autocomplete-for-email-command
Autocomplete for email command
2 parents 8cad4ab + e977237 commit 3cc1c81

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

lib/Command/SendEmails.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,18 @@
2323

2424
namespace OCA\Activity\Command;
2525

26+
use OC\Core\Command\Base;
2627
use OCA\Activity\MailQueueHandler;
2728
use OCA\Activity\UserSettings;
2829
use OCP\IConfig;
2930
use OCP\ILogger;
30-
use Symfony\Component\Console\Command\Command;
31+
use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext;
3132
use Symfony\Component\Console\Input\InputArgument;
3233
use Symfony\Component\Console\Input\InputInterface;
3334
use Symfony\Component\Console\Input\InputOption;
3435
use Symfony\Component\Console\Output\OutputInterface;
3536

36-
class SendEmails extends Command {
37+
class SendEmails extends Base {
3738

3839
/** @var MailQueueHandler */
3940
protected $queueHandler;
@@ -115,4 +116,16 @@ protected function execute(InputInterface $input, OutputInterface $output) {
115116

116117
return 0;
117118
}
119+
120+
/**
121+
* @param string $argumentName
122+
* @param CompletionContext $context
123+
* @return string[]
124+
*/
125+
public function completeArgumentValues($argumentName, CompletionContext $context) {
126+
if ($argumentName === 'restrict-batching') {
127+
return ['asap', 'hourly', 'daily', 'weekly'];
128+
}
129+
return [];
130+
}
118131
}

0 commit comments

Comments
 (0)