mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
Fixed logic issue where checking for wrong option
Signed-off-by: Adam Blakey <adam@blakey.family>
This commit is contained in:
parent
e9fb7a2885
commit
a676a67b9e
1 changed files with 7 additions and 8 deletions
|
|
@ -75,16 +75,15 @@ class ListApps extends Base {
|
|||
$shippedFilter = null;
|
||||
}
|
||||
|
||||
if ($input->getOption('enabled') !== '' && $input->getOption('disabled') !== '') {
|
||||
$output->writeln('<error>You can only use at most one of the options ' .
|
||||
'"enabled" or "disabled"</error>');
|
||||
return 1;
|
||||
if ($input->getOption('enabled') && $input->getOption('disabled')) {
|
||||
$showEnabledApps = true;
|
||||
$showDisabledApps = true;
|
||||
}
|
||||
else if ($input->getOption('enabled') !== '') {
|
||||
else if ($input->getOption('enabled')) {
|
||||
$showEnabledApps = true;
|
||||
$showDisabledApps = false;
|
||||
}
|
||||
else if ($input->getOption('disabled') !== '') {
|
||||
else if ($input->getOption('disabled')) {
|
||||
$showEnabledApps = false;
|
||||
$showDisabledApps = true;
|
||||
}
|
||||
|
|
@ -141,12 +140,12 @@ class ListApps extends Base {
|
|||
protected function writeAppList(InputInterface $input, OutputInterface $output, $items) {
|
||||
switch ($input->getOption('output')) {
|
||||
case self::OUTPUT_FORMAT_PLAIN:
|
||||
if ($items['enabled']) {
|
||||
if (isset($items['enabled'])) {
|
||||
$output->writeln('Enabled:');
|
||||
parent::writeArrayInOutputFormat($input, $output, $items['enabled']);
|
||||
}
|
||||
|
||||
if ($items['disabled']) {
|
||||
if (isset($items['disabled'])) {
|
||||
$output->writeln('Disabled:');
|
||||
parent::writeArrayInOutputFormat($input, $output, $items['disabled']);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue