Skip to content

Commit b585280

Browse files
committed
feat(userList): Allow to list all users
Signed-off-by: Git'Fellow <[email protected]>
1 parent 154f359 commit b585280

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

core/Command/User/ListCommand.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected function configure() {
3535
'limit',
3636
'l',
3737
InputOption::VALUE_OPTIONAL,
38-
'Number of users to retrieve',
38+
'Number of users to retrieve (0 for unlimited)',
3939
'500'
4040
)->addOption(
4141
'offset',
@@ -58,10 +58,16 @@ protected function configure() {
5858
}
5959

6060
protected function execute(InputInterface $input, OutputInterface $output): int {
61+
$limit = (int)$input->getOption('limit');
62+
$offset = (int)$input->getOption('offset');
63+
64+
// Allow --limit 0 to mean unlimited
65+
$actualLimit = ($limit === 0) ? null : $limit;
66+
6167
if ($input->getOption('disabled')) {
62-
$users = $this->userManager->getDisabledUsers((int)$input->getOption('limit'), (int)$input->getOption('offset'));
68+
$users = $this->userManager->getDisabledUsers($actualLimit, $offset);
6369
} else {
64-
$users = $this->userManager->searchDisplayName('', (int)$input->getOption('limit'), (int)$input->getOption('offset'));
70+
$users = $this->userManager->searchDisplayName('', $actualLimit, $offset);
6571
}
6672

6773
$this->writeArrayInOutputFormat($input, $output, $this->formatUsers($users, (bool)$input->getOption('info')));

0 commit comments

Comments
 (0)