Skip to content
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

app/console list --xml generates inconsistent data #2667

deguif opened this issue Nov 17, 2011 · 3 comments


None yet
4 participants
Copy link

commented Nov 17, 2011

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.

    <argument name="command" is_required="1" is_array="0">
      <description>The command to execute</description>
    <argument name="namespace" is_required="0" is_array="0">
      <description>The namespace name</description>

This comment has been minimized.

Copy link

commented Mar 10, 2012

@vicb Can you assign this to me?


This comment has been minimized.

Copy link

commented Mar 10, 2012

@meandmymonkey the github assignments work only for people that are members of the organization so we don't use them


This comment has been minimized.

Copy link

commented Mar 10, 2012

Ok, thanks.

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.

fabpot added a commit that referenced this issue Mar 12, 2012

merged branch meandmymonkey/xml-output-fix (PR #3569)

705e460 provided unmerged definition for correct help generation
45bbb5b added getNativeDefinition() to allow specifying an alternate InputDefinition for help generation


[Console] Xml output fix

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2667
Todo: add specific test

As per my comment [here](#2667 (comment)), added the ability to provide an InputDefinition that will not be changed by merging with the Application InputDefinition..

@fabpot fabpot closed this Mar 12, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.