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

[2.2][Console] Add possibility to add new input options to console application #5638

Closed
wants to merge 2 commits into from

Conversation

dirkaholic
Copy link
Contributor

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -

At the moment it is not possible to overwrite the input arguments of a console application to not have the default ones. Adding is possible with:

$cli->getDefinition()->addOption(new InputOption('--custom', '-c', InputOption::VALUE_NONE, 'Use custom option.'));

Also added some simple tests for adding a custom HelperSet.

*
* @api
*/
public function setDefinition(InputDefinition $definition)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can already do that by extending the application and overriding the getDefaultInputDefinition method.

@dirkaholic
Copy link
Contributor Author

OK, is a bit inconsistent with what it's done with the helper set then, where you can use both ways. New PR for the tests is the referenced one.

@stof
Copy link
Member

stof commented Oct 4, 2012

@dirkaholic Can you rebase your branch (it conflicts with master) and squash your commit together ?

http://symfony.com/doc/current/contributing/code/patches.html#rework-your-patch may help you if you don't know how to do it

@dirkaholic
Copy link
Contributor Author

Done.

@stof
Copy link
Member

stof commented Oct 4, 2012

@dirkaholic the rebase worked fine but you have not squashed the commits together.

@dirkaholic
Copy link
Contributor Author

What do you mean ? Only the setDefinition function plus test is left here. The rest was already merged with #5668

@stof
Copy link
Member

stof commented Oct 5, 2012

@dirkaholic Squashing is about making the PR use only 1 commit instead of 2 (the second one changing only some whitespaces, which is not what its message says). But @fabpot told me that he improved his merging tool and so he can squash it when merging so it is OK.

@fabpot fabpot closed this in d4c011d Oct 27, 2012
craigmarvelley pushed a commit to craigmarvelley/symfony that referenced this pull request Nov 26, 2013
This PR was squashed before being merged into the master branch (closes symfony#5668).

Commits
-------

1117499 [2.2][Console] Test default input defintion and default helper set

Discussion
----------

[2.2][Console] Test default input defintion and default helper set

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -

See: symfony#5638
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants