Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions core/Command/User/ListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected function configure() {
'limit',
'l',
InputOption::VALUE_OPTIONAL,
'Number of users to retrieve',
'Number of users to retrieve (0 for unlimited)',
'500'
)->addOption(
'offset',
Expand All @@ -58,10 +58,16 @@ protected function configure() {
}

protected function execute(InputInterface $input, OutputInterface $output): int {
$limit = (int)$input->getOption('limit');
$offset = (int)$input->getOption('offset');

// Allow --limit 0 to mean unlimited
$actualLimit = ($limit === 0) ? null : $limit;

if ($input->getOption('disabled')) {
$users = $this->userManager->getDisabledUsers((int)$input->getOption('limit'), (int)$input->getOption('offset'));
$users = $this->userManager->getDisabledUsers($actualLimit, $offset);
} else {
$users = $this->userManager->searchDisplayName('', (int)$input->getOption('limit'), (int)$input->getOption('offset'));
$users = $this->userManager->searchDisplayName('', $actualLimit, $offset);
}

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