Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #54347 [Console] Allow to return all tokens after the command…
… name (lyrixx) This PR was merged into the 7.1 branch. Discussion ---------- [Console] Allow to return all tokens after the command name | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | no | New feature? | yes | Deprecations? | no | Issues | | License | MIT follows #54238 Now, we can make it works at the command level (previous PR was at the application level) ```php #!/usr/bin/env php <?php use Symfony\Component\Console\Application; use Symfony\Component\Console\Command\Command; use Symfony\Component\Process\Process; require __DIR__ . '/vendor/autoload.php'; $command = new Command('ls'); $command->ignoreValidationErrors(); $command->setCode(function ($input) { $p = new Process(['ls', ...$input->getRawTokens(true)]); $p->setTty(true); $p->mustRun(); }); $app = new Application(); $app->add($command); $app->run(); ``` ![image](https://github.com/symfony/symfony/assets/408368/39b47b14-c2bb-4df6-ad79-26a2fe888523) Commits ------- cef1979 [Console] Allow to returns all tokens after the command name
- Loading branch information