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
Conversation
* | ||
* @api | ||
*/ | ||
public function setDefinition(InputDefinition $definition) |
There was a problem hiding this comment.
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.
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. |
@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 |
…putDefinition and getDefaultHelperSet
Done. |
@dirkaholic the rebase worked fine but you have not squashed the commits together. |
What do you mean ? Only the setDefinition function plus test is left here. The rest was already merged with #5668 |
@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. |
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
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.