8000 [Console] Not possible to have a default command. · Issue #8058 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Console] Not possible to have a default command. #8058

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

Closed
henrikbjorn opened this issue May 16, 2013 · 8 comments
Closed

[Console] Not possible to have a default command. #8058

henrikbjorn opened this issue May 16, 2013 · 8 comments
Labels

Comments

@henrikbjorn
Copy link
Contributor

Today it is not possible to have another name returned from getCommandName because it will merge a default defintion where command argument is required. Also it is not possible to circumvent this by adding the argument to the input as it happens later when the command is bound.

@jfsimon
Copy link
Contributor
jfsimon commented Jul 10, 2013

You'd like to replace default list command with another one of your choice, that's it?

@henrikbjorn
Copy link
Contributor Author

Well yes and no, the list command does not come from getCommandName but in functionality you are correct, and this could be achieved with overriding the doRun method and an ArrayInput but i should be doable with getCommandName.

@jfsimon
Copy link
Contributor
jfsimon commented Jul 10, 2013

Okay, what's the point of your issue, you want to be able to change default command by overriding getCommandName()? Why no introduce a setDefaultCommand() method?

@henrikbjorn
Copy link
Contributor Author

http://d.pr/i/Vgwk is the error, wanted to remove the hack of changing the default command. if a setDefaultCommand is introduced i would use that.

@kamazee
Copy link
Contributor
kamazee commented Nov 15, 2013

Did you consider overriding getDefaultCommand in your Application class?

@henrikbjorn
Copy link
Contributor Author

Dosent work either :)

@soxofaan
Copy link

I guess this is related: #9564

@dcsg
Copy link
Member
dcsg commented Dec 14, 2013

@soxofaan I think is not related since #9564 wants to take care of running only one command for application and in this case the idea is to define a different default command for the application but does not meant that the application will have only one command.

dcsg added a commit to dcsg/symfony that referenced this issue Dec 14, 2013
* Added new method `setDefaultCommand` and changed the logic in the doRun
method in order to allow it to run by default a Command setted by the user
instead of the `ListCommand`
* Added tests
* Should fix symfony#8058
dcsg added a commit to dcsg/symfony that referenced this issue Dec 15, 2013
* Added new method `setDefaultCommand` and changed the logic in the doRun
method in order to allow it to run by default a Command setted by the user
instead of the `ListCommand`
* Added tests
* Should fix symfony#8058
* Updated CHANGELOG
dcsg added a commit to dcsg/symfony 9AE6 that referenced this issue Jan 4, 2014
* Added new method `setDefaultCommand` and changed the logic in the doRun
method in order to allow it to run by default a Command setted by the user
instead of the `ListCommand`
* Added tests
* Should fix symfony#8058
* Updated CHANGELOG
dcsg added a commit to dcsg/symfony that referenced this issue Jan 4, 2014
* Added new method `setDefaultCommand` and changed the logic in the doRun
method in order to allow it to run by default a Command setted by the user
instead of the `ListCommand`
* Added tests
* Should fix symfony#8058
* Updated CHANGELOG
fabpot added a commit that referenced this issue Jan 7, 2014
…ult command (danielcsgomes)

This PR was squashed before being merged into the 2.5-dev branch (closes #9776).

Discussion
----------

[Console] Added the possibility to set a different default command

I am not quite sure if this is the best approach to solve the issue but the solution I provide works. Let me know your suggestions to improve it.

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #8058
| License       | MIT
| Doc PR       | symfony/symfony-docs#3426

Commits
-------

418de05 [Console] Added the possibility to set a different default command
@fabpot fabpot closed this as completed Jan 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants
0