Skip to content

Commit 039264d

Browse files
committed
[Console] Fixed tests about message exception when command is not available
1 parent a4d2d31 commit 039264d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/Symfony/Component/Console/Application.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,12 @@ public function findNamespace($namespace)
496496
}
497497

498498
if ($alternatives = $this->findAlternativeNamespace($part, $abbrevs)) {
499-
$message .= "\n\nDid you mean one of these?\n ";
499+
if (1 == count($alternatives)) {
500+
$message .= "\n\nDid you mean this?\n ";
501+
} else {
502+
$message .= "\n\nDid you mean one of these?\n ";
503+
}
504+
500505
$message .= implode("\n ", $alternatives);
501506
}
502507

@@ -571,7 +576,11 @@ public function find($name)
571576
$message = sprintf('Command "%s" is not defined.', $name);
572577

573578
if ($alternatives = $this->findAlternativeCommands($searchName, $abbrevs)) {
574-
$message .= "\n\nDid you mean one of these?\n ";
579+
if (1 == count($alternatives)) {
580+
$message .= "\n\nDid you mean this?\n ";
581+
} else {
582+
$message .= "\n\nDid you mean one of these?\n ";
583+
}
575584
$message .= implode("\n ", $alternatives);
576585
}
577586

0 commit comments

Comments
 (0)