Skip to content

Commit f88c9eb

Browse files
committed
Do not break the output when running _completion
Signed-off-by: Joas Schilling <[email protected]>
1 parent f2809ff commit f88c9eb

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lib/private/Console/Application.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,14 @@ public function loadCommands(InputInterface $input, OutputInterface $output) {
8888
require_once __DIR__ . '/../../../core/register_command.php';
8989
if ($this->config->getSystemValue('installed', false)) {
9090
if (\OCP\Util::needUpgrade()) {
91-
$output->writeln("Nextcloud or one of the apps require upgrade - only a limited number of commands are available");
92-
$output->writeln("You may use your browser or the occ upgrade command to do the upgrade");
91+
if ($input->getArgument('command') !== '_completion') {
92+
$output->writeln("Nextcloud or one of the apps require upgrade - only a limited number of commands are available");
93+
$output->writeln("You may use your browser or the occ upgrade command to do the upgrade");
94+
}
9395
} elseif ($this->config->getSystemValue('maintenance', false)) {
94-
$output->writeln("Nextcloud is in maintenance mode - no app have been loaded");
96+
if ($input->getArgument('command') !== '_completion') {
97+
$output->writeln("Nextcloud is in maintenance mode - no apps have been loaded");
98+
}
9599
} else {
96100
OC_App::loadApps();
97101
foreach (\OC::$server->getAppManager()->getInstalledApps() as $app) {
@@ -106,10 +110,10 @@ public function loadCommands(InputInterface $input, OutputInterface $output) {
106110
}
107111
}
108112
}
109-
} else {
113+
} else if ($input->getArgument('command') !== '_completion') {
110114
$output->writeln("Nextcloud is not installed - only a limited number of commands are available");
111115
}
112-
$input = new ArgvInput();
116+
113117
if ($input->getFirstArgument() !== 'check') {
114118
$errors = \OC_Util::checkServer(\OC::$server->getConfig());
115119
if (!empty($errors)) {

0 commit comments

Comments
 (0)