From 039264d2d210c09b851d4ba47f591066400d47d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Tue, 7 Aug 2012 16:16:59 +0200 Subject: [PATCH] [Console] Fixed tests about message exception when command is not available --- src/Symfony/Component/Console/Application.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index 9fc851877f..63f16e87d7 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -496,7 +496,12 @@ class Application } if ($alternatives = $this->findAlternativeNamespace($part, $abbrevs)) { - $message .= "\n\nDid you mean one of these?\n "; + if (1 == count($alternatives)) { + $message .= "\n\nDid you mean this?\n "; + } else { + $message .= "\n\nDid you mean one of these?\n "; + } + $message .= implode("\n ", $alternatives); } @@ -571,7 +576,11 @@ class Application $message = sprintf('Command "%s" is not defined.', $name); if ($alternatives = $this->findAlternativeCommands($searchName, $abbrevs)) { - $message .= "\n\nDid you mean one of these?\n "; + if (1 == count($alternatives)) { + $message .= "\n\nDid you mean this?\n "; + } else { + $message .= "\n\nDid you mean one of these?\n "; + } $message .= implode("\n ", $alternatives); }