You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I suggest to make 2 changes.
a) Remove the shortcut "e" from the LintCommand. There are possibly more Commands (from vendors) with invalid shortcuts. How to find them all? PR
b) Make a List of reserved Shortcuts by symfony and do not allow them in InputOption as shortcut.
Ignore them and make a warning?
The text was updated successfully, but these errors were encountered:
…mmand - solve conflict with --env -e (Chris53897)
This PR was merged into the 5.4 branch.
Discussion
----------
[Yaml] remove shortcut e for option exclude of Yaml/LintCommand - solve conflict with --env -e
…- solve conflict with --env -e
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#43086
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Fix for command options shortcut conflict
Commits
-------
bc95dbdfix: #43086 remove shortcut e for option exclude of Yaml/LintCommand - solve conflict with --env -e
* 5.4:
[Serializer] Save missing arguments in MissingConstructorArgumentsException
remove support for deprecated "threadKey" parameter
Remove useless comment in test
[DomCrawler] Added Crawler::innerText() method
[Form] Add the EnumType
Fix iterrator in ServiceConfigurator
[Console] Add support of RGB functional notation for output colors
Add Slovak lang translation #41081
[Validator] Add error's uid to `Count` and `Length` constraints with "exactly" option enabled
[Validator] Add missing thai translation
[Yaml] Add 0 to float repr
[Translation] Add Burmese translation
[Notifier] Update FirebaseTransport.php
fix: #43086 remove shortcut e for option exclude of Yaml/LintCommand - solve conflict with --env -e
Map `multipart/form-data` as `form` Content-Type
[Serializer] Throw NotNormalizableValueException when type is not known or not in body in discriminator map
[Yaml] Use more concise float representation in dump
[FrameworkBundle] Remove translation data_collector BEFORE adding it to profiler
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected: 5.4.x-dev
Description
The paramter --format of the console function list is not working correctly.
Error: An option with shortcut "e" already exists.
symfony console list --format=json
symfony console list --format=xml
Options:
symfony console list --help
works:
symfony console list
symfony console list --raw
symfony console list --env=dev
How to reproduce
composer create-project symfony/website-skeleton:"^5.4-dev" console-test
cd console-test
symfony console list --format=json
Possible solution
I guess i found the error:
In LintCommand there is a new option "exclude" and shortcut "e".
https://github.com/christingruber/symfony/blob/55704f3d9e8315abfd0b9cbacc144d80a888882c/src/Symfony/Component/Yaml/Command/LintCommand.php
I changed
symfony/console/Command/Command.php
for debugging`public function addOption(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null)
{
if($shortcut=="e")
{
var_dump($name. " : ". $shortcut);
}
else{
$this->definition->addOption(new InputOption($name, $shortcut, $mode, $description, $default));
if (null !== $this->fullDefinition) {
$this->fullDefinition->addOption(new InputOption($name, $shortcut, $mode, $description, $default));
}
}
After that it works.
I suggest to make 2 changes.
a) Remove the shortcut "e" from the LintCommand. There are possibly more Commands (from vendors) with invalid shortcuts. How to find them all? PR
b) Make a List of reserved Shortcuts by symfony and do not allow them in InputOption as shortcut.
Ignore them and make a warning?
The text was updated successfully, but these errors were encountered: