Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7534fb1

Browse filesBrowse files
committed
Improve message when shell is not detected
1 parent 38b0c19 commit 7534fb1
Copy full SHA for 7534fb1

File tree

1 file changed

+8
-2
lines changed
Filter options

1 file changed

+8
-2
lines changed

‎src/Symfony/Component/Console/Command/DumpCompletionCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Command/DumpCompletionCommand.php
+8-2Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9393
if (!file_exists($completionFile)) {
9494
$supportedShells = $this->getSupportedShells();
9595

96-
($output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output)
97-
->writeln(sprintf('<error>Detected shell "%s", which is not supported by Symfony shell completion (supported shells: "%s").</>', $shell, implode('", "', $supportedShells)));
96+
if ($output instanceof ConsoleOutputInterface) {
97+
$output = $output->getErrorOutput();
98+
}
99+
if ($shell) {
100+
$output->writeln(sprintf('<error>Detected shell "%s", which is not supported by Symfony shell completion (supported shells: "%s").</>', $shell, implode('", "', $supportedShells)));
101+
} else {
102+
$output->writeln(sprintf('<error>Shell not detected, Symfony shell completion only supports "%s").</>', implode('", "', $supportedShells)));
103+
}
98104

99105
return self::INVALID;
100106
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.