-
-
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?
Add the option to provide a groupname and only see its' members in occ group:list #49016
Conversation
bd2d651
to
7b82a6a
Compare
@joshtrichards Hey thanks for tagging/milestoning! Is there anything I can do to help move things along? |
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
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>
8ef7a7d
to
c7acab5
Compare
$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')); |
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.
That’s not ideal, If there are groups abc
and abc1
and you use group:list abc you will get both 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 --list-members
option to group:info
, that’s what make the most sense to me.
@@ -23,6 +24,12 @@ protected function configure() { | |||
$this | |||
->setName('group:list') | |||
->setDescription('list configured groups') | |||
->addArgument( | |||
'groupid', |
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.
'groupid', | |
'searchstring', |
->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 comment
The reason will be displayed to describe this comment to others. Learn more.
'Group id to show only the members of that group', | |
'Filter the groups to only those matching the search string', |
@@ -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')); |
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.
$groups = $this->groupManager->search((string)$input->getArgument('groupid'), (int)$input->getOption('limit'), (int)$input->getOption('offset')); | |
$groups = $this->groupManager->search((string)$input->getArgument('searchstring'), (int)$input->getOption('limit'), (int)$input->getOption('offset')); |
Summary
As the title states this adds an optional groupname argument to
occ group:list
so you can see the members of just that group.Now you can do
occ group:list groupname
If the change is welcome I can work on the further needed steps to get it in.
TODO
Checklist
- [ ] Screenshots before/after for front-end changes