aboutsummaryrefslogtreecommitdiffstats
path: root/core/Command
diff options
context:
space:
mode:
authorE.S. Rosenberg a.k.a. Keeper of the Keys <es.rosenberg+github@gmail.com>2024-10-30 15:09:25 +0200
committerAndy Scherzinger <info@andy-scherzinger.de>2025-01-08 20:14:07 +0100
commitc7acab5bf73dc96b883c1e9d7bd736769185fb84 (patch)
tree60856f8d9772d91d0e7c7fe3499be2aec0479e8e /core/Command
parentd69f2bcb12af6afdc11ca8ab4e456d042c5b2c10 (diff)
downloadnextcloud-server-c7acab5bf73dc96b883c1e9d7bd736769185fb84.tar.gz
nextcloud-server-c7acab5bf73dc96b883c1e9d7bd736769185fb84.zip
Add the option to provide a groupname and only see its' members.
Improvements/TODO: 1. Fail/return error if group doesn't exist 2. Only print the members and not the groupname Signed-off-by: E.S. Rosenberg a.k.a. Keeper of the Keys <es.rosenberg+github@gmail.com>
Diffstat (limited to 'core/Command')
-rw-r--r--core/Command/Group/ListCommand.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/core/Command/Group/ListCommand.php b/core/Command/Group/ListCommand.php
index 13161ec0eaa..5f216a02e1c 100644
--- a/core/Command/Group/ListCommand.php
+++ b/core/Command/Group/ListCommand.php
@@ -8,6 +8,7 @@ namespace OC\Core\Command\Group;
use OC\Core\Command\Base;
use OCP\IGroup;
use OCP\IGroupManager;
+use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
@@ -23,6 +24,12 @@ class ListCommand extends Base {
$this
->setName('group:list')
->setDescription('list configured groups')
+ ->addArgument(
+ 'groupid',
+ InputArgument::OPTIONAL,
+ 'Group id to show only the members of that group',
+ ''
+ )
->addOption(
'limit',
'l',
@@ -50,7 +57,7 @@ class ListCommand extends Base {
}
protected function execute(InputInterface $input, OutputInterface $output): int {
- $groups = $this->groupManager->search('', (int)$input->getOption('limit'), (int)$input->getOption('offset'));
+ $groups = $this->groupManager->search((string)$input->getArgument('groupid'), (int)$input->getOption('limit'), (int)$input->getOption('offset'));
$this->writeArrayInOutputFormat($input, $output, $this->formatGroups($groups, (bool)$input->getOption('info')));
return 0;
}