diff options
author | Stephan Orbaugh <62374139+sorbaugh@users.noreply.github.com> | 2025-02-03 13:10:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-03 13:10:00 +0100 |
commit | 8aad48c6f911507b055ef59965dcf26c58430c2c (patch) | |
tree | d2d05902d67cfe3db5b535fa109ff7db83670a20 /core/Command | |
parent | e9cb6140debb56ce918a42460027b8c727e58d52 (diff) | |
parent | 5e97a46f4c141c950bc2c73e2cd5a2f0825e451c (diff) | |
download | nextcloud-server-8aad48c6f911507b055ef59965dcf26c58430c2c.tar.gz nextcloud-server-8aad48c6f911507b055ef59965dcf26c58430c2c.zip |
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
Diffstat (limited to 'core/Command')
-rw-r--r-- | core/Command/Group/ListCommand.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/core/Command/Group/ListCommand.php b/core/Command/Group/ListCommand.php index 13161ec0eaa..a3622585d18 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( + 'searchstring', + InputArgument::OPTIONAL, + 'Filter the groups to only those matching the search string', + '' + ) ->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('searchstring'), (int)$input->getOption('limit'), (int)$input->getOption('offset')); $this->writeArrayInOutputFormat($input, $output, $this->formatGroups($groups, (bool)$input->getOption('info'))); return 0; } |