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
When an exception occurs while validating or running a Symfony Console command, an error message is shown to the user.
The last line of the error message is a synopsis of how the command should be called. This synopsis is incorrect: it states that the first non-option argument should be <command>. But the command itself is already shown at the start of the synopsis.
How to reproduce
Install the Symfony skeleton and run the following command:
bin/console secrets:list --foo
An error is shown of which the last line is the following:
Also in this synopsis, <command> should not be there.
Possible Solution
Unknown.
Additional context
The synopsis is printed on line 774 of src/Symfony/Component/Console/Application.php. On this line the method \Symfony\Component\Console\Command\Command::getSynopsis is called, which in turn calls \Symfony\Component\Console\Input\InputDefinition::getSynopsis. In this method, all non-option arguments are enclosed in < and > and are added to the synopsis; this happens on line 375 of src/Symfony/Component/Console/Input/InputDefinition.php. So the first element of $this->getArguments() is an argument with name command.
Symfony version(s) affected: 5.1.8
Description
When an exception occurs while validating or running a Symfony Console command, an error message is shown to the user.
The last line of the error message is a synopsis of how the command should be called. This synopsis is incorrect: it states that the first non-option argument should be
<command>
. But the command itself is already shown at the start of the synopsis.How to reproduce
Install the Symfony skeleton and run the following command:
An error is shown of which the last line is the following:
In this synopsis,
<command>
at the end of the line should not be there.Similarly, the command
also shows an error with the following last line:
Also in this synopsis,
<command>
should not be there.Possible Solution
Unknown.
Additional context
The synopsis is printed on line 774 of
src/Symfony/Component/Console/Application.php
. On this line the method\Symfony\Component\Console\Command\Command::getSynopsis
is called, which in turn calls\Symfony\Component\Console\Input\InputDefinition::getSynopsis
. In this method, all non-option arguments are enclosed in<
and>
and are added to the synopsis; this happens on line 375 of src/Symfony/Component/Console/Input/InputDefinition.php. So the first element of$this->getArguments()
is an argument with namecommand
.This issue is possibly related to #38904.
The text was updated successfully, but these errors were encountered: