zenstruck / console-extra

A modular set of features to reduce configuration boilerplate for your Symfony commands.
MIT License
78 stars 3 forks source link

--help not working in command runner #35

Closed tacman closed 2 years ago

tacman commented 2 years ago

Using the MyCommand example in the documentation

use Zenstruck\Console\CommandRunner;
class AppController extends AbstractController
{

    #[Route(path: '/run-command', name: 'app_run_command')]
    public function runCommand(MyCommand $command): Response
    {
        CommandRunner::for($command, 'Bob p@ssw0rd --role ROLE_ADMIN')->run(); // works great
        CommandRunner::for($command, '--help')->run(); // fails, says --help isn't defined
    }
}
tacman commented 2 years ago

Duplicate of #34