-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Description
Symfony version(s) affected
all, I guess
Description
$ php index.php command --help
Command "command" is not defined.
Do you want to run "my:command" instead? (yes/no) [no]:
> yes
Hello, World!- Here, I passed the
--helpflag on a command that does not exist. - Symfony find the real command, and made a proposition.
- I type
yes, to the proposition - Symfony runs the command, but without the
--helpflag
I think the --help should be preserved
How to reproduce
<?php
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
require __DIR__ . '/vendor/autoload.php';
$app = new Application('My Console App', '1.0.0');
$command = new Command();
$command->setName('my:command')
->setDescription('This is my custom command.')
->setCode(function () {
echo "Hello, World!\n";
return 1;
});
$app->addCommand($command);
$app->run();Then, execute:
php index.php command --help
Possible Solution
No response
Additional Context
No response
damienalexandre and santysisi