New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Input values setted by console.command event are cleared #19441
Comments
Please provide some more details about the issue you are experiencing (what did you expect, what happened instead) and how to reproduce it. |
It occurs when:
|
I'm not sure if it's realted to the original issue. But at the moment it's not easy to add application wide options to the commands. I have a use case where I need to add some global options to all commands, splitted in various listeners, and I'm having a hard time. I think the command needs one more event :
What do you think of this ? ATM I've found a workaroung like this :
Moreover, the "parseShortOptionSet" method seems buggy and does throw an error for a custom alias of mine "wi" (so I'm forced to defined two aliases, "w|wi"):
|
I was able to confirm that issue. Currently updating input arguments values on command event doesn't work (even tho we are able to access method
Please see gist reproducing the issue: https://gist.github.com/jzawadzki/62bfc3fec5afe7a93163deb08ddc1e29 |
Confirmed it also 👍 |
Confirmed here too! |
Status: reviewed See #21841 |
…mmand event (chalasr) This PR was merged into the 2.8 branch. Discussion ---------- [Console] Do not squash input changes made from console.command event | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #19441 | License | MIT | Doc PR | n/a Setting arguments/options from the `console.command` event is expected to work since #15938 Commits ------- c8d364b [Console] Do not squash input changes made from console.command event
This should be re-opened as the patch has been reverted. |
Hi, I have just had the same problem and used configurators, to add options/arguments for a subset of commands. The functionality of configurators are described in the following url: To apply options/arguments only for a subset of commands, I've declared a Interface, tagged all commands implementing those interface and set the configurator for all tagged services. I know it has nothing todo with the patch, but is a alternative approach to achieve the expected behavior. Best regards, |
Hey, thanks for your report! |
I have been trying to solve this through different ways, but didn't manage to find a sensible fix. |
The input values setted by console.command event are cleared by Symfony\Component\Console\Command\Command::bin() called by Symfony\Component\Console\Command\Command::run()
The text was updated successfully, but these errors were encountered: