Join GitHub today
app/console list --xml generates inconsistent data #2667
When using symfony console to retrieve xml formated commands, the command list indicates that the first argument command is required but that isn't true.
Anyway, the reason for this behaviour seems to be the way the output for the list command is built - the Application::asXml() method iterates over all its command instances.
At this time, the ListCommand, which is part of this instance list, is already running and has already called $this->mergeApplicationDefinition(), which has merged the Application's InputDefinition containing the required 'command' argument in to the ListCommand's InputDefinition - therefore the added argument.
Looking for a way to solve this... after the merge, there is no way of checking if an argument was originally part of the Command or part of the Application, which would be needed to solve this in a clean way.
BTW, this means in theory the error applies to the text output format as well, the info is just not rendered so the bug does not appear.