diff options
author | Adam Blakey <adam@blakey.family> | 2022-08-15 21:59:16 +0200 |
---|---|---|
committer | Adam Blakey <adam@blakey.family> | 2022-08-15 21:59:16 +0200 |
commit | a676a67b9ecdb3ec83b6e2e7077a5fa68d220893 (patch) | |
tree | d89e0b3781abbe2dcb21006a549656be41f06fd6 | |
parent | e9fb7a288515c92e9fa4314cc789dbbe380a4828 (diff) | |
download | nextcloud-server-a676a67b9ecdb3ec83b6e2e7077a5fa68d220893.tar.gz nextcloud-server-a676a67b9ecdb3ec83b6e2e7077a5fa68d220893.zip |
Fixed logic issue where checking for wrong option
Signed-off-by: Adam Blakey <adam@blakey.family>
-rw-r--r-- | core/Command/App/ListApps.php | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/core/Command/App/ListApps.php b/core/Command/App/ListApps.php index 2d01e9f5904..6cb91aae39c 100644 --- a/core/Command/App/ListApps.php +++ b/core/Command/App/ListApps.php @@ -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']); } |