diff options
Diffstat (limited to 'core/Command/Group/Delete.php')
-rw-r--r-- | core/Command/Group/Delete.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/Command/Group/Delete.php b/core/Command/Group/Delete.php index be97be83407..2596b461d17 100644 --- a/core/Command/Group/Delete.php +++ b/core/Command/Group/Delete.php @@ -27,7 +27,9 @@ declare(strict_types=1); namespace OC\Core\Command\Group; use OC\Core\Command\Base; +use OCP\IGroup; use OCP\IGroupManager; +use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -74,4 +76,16 @@ class Delete extends Base { } return 0; } + + /** + * @param string $argumentName + * @param CompletionContext $context + * @return string[] + */ + public function completeArgumentValues($argumentName, CompletionContext $context) { + if ($argumentName === 'groupid') { + return array_map(static fn (IGroup $group) => $group->getGID(), $this->groupManager->search($context->getCurrentWord())); + } + return []; + } } |