Skip to content

Commit 8aad48c

Browse files
authored
Merge pull request #49016 from Keeper-of-the-Keys/occ-groups-list-single-group
Add the option to provide a groupname and only see its' members in occ group:list
2 parents e9cb614 + 5e97a46 commit 8aad48c

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

core/Command/Group/ListCommand.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use OC\Core\Command\Base;
99
use OCP\IGroup;
1010
use OCP\IGroupManager;
11+
use Symfony\Component\Console\Input\InputArgument;
1112
use Symfony\Component\Console\Input\InputInterface;
1213
use Symfony\Component\Console\Input\InputOption;
1314
use Symfony\Component\Console\Output\OutputInterface;
@@ -23,6 +24,12 @@ protected function configure() {
2324
$this
2425
->setName('group:list')
2526
->setDescription('list configured groups')
27+
->addArgument(
28+
'searchstring',
29+
InputArgument::OPTIONAL,
30+
'Filter the groups to only those matching the search string',
31+
''
32+
)
2633
->addOption(
2734
'limit',
2835
'l',
@@ -50,7 +57,7 @@ protected function configure() {
5057
}
5158

5259
protected function execute(InputInterface $input, OutputInterface $output): int {
53-
$groups = $this->groupManager->search('', (int)$input->getOption('limit'), (int)$input->getOption('offset'));
60+
$groups = $this->groupManager->search((string)$input->getArgument('searchstring'), (int)$input->getOption('limit'), (int)$input->getOption('offset'));
5461
$this->writeArrayInOutputFormat($input, $output, $this->formatGroups($groups, (bool)$input->getOption('info')));
5562
return 0;
5663
}

0 commit comments

Comments
 (0)