-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the option to provide a groupname and only see its' members in occ group:list #49016
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -8,6 +8,7 @@ | |||||
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 @@ protected function configure() { | |||||
$this | ||||||
->setName('group:list') | ||||||
->setDescription('list configured groups') | ||||||
->addArgument( | ||||||
'groupid', | ||||||
InputArgument::OPTIONAL, | ||||||
'Group id to show only the members of that group', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
'' | ||||||
) | ||||||
->addOption( | ||||||
'limit', | ||||||
'l', | ||||||
|
@@ -50,7 +57,7 @@ protected function configure() { | |||||
} | ||||||
|
||||||
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')); | ||||||
Comment on lines
-53
to
+60
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That’s not ideal, If there are groups That said, maybe it’s actually better and we should just document the argument to be a search string and not a group name? Not sure. I think we should document this as search string and merge it, and in an other PR add a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
$this->writeArrayInOutputFormat($input, $output, $this->formatGroups($groups, (bool)$input->getOption('info'))); | ||||||
return 0; | ||||||
} | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.