Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Allow --verbose option to accept values #17647

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
wants to merge 1 commit into from

Conversation

javiereguiluz
Copy link
Member

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #10487
License MIT
Doc PR -

The special --verbose option was defined as this:

new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, ...),

This is wrong, because --verbose option must accept integer values (--verbose=1, --verbose=2, etc.) which are equivalent to the short options (-v, -vv, etc.):

new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_OPTIONAL, ...),

In our test suite we already test values for this option:

$tester->run(array('command' => 'list', '--verbose' => 2));

But we didn't test them in the following way, which is now supported after this fix:

$input = new ArgvInput(array('cli.php', '--verbose=2'));
$application->run($input, $output);

@nicolas-grekas
Copy link
Member

👍

@stof
Copy link
Member

stof commented Feb 3, 2016

this is a BC break. It breaks the usage of app/console container:debug --verbose twig as twig is now considered as being the option value instead of the argument.
This change was already merged in the past and reverted because of that

@fabpot
Copy link
Member

fabpot commented Feb 3, 2016

I have not tested this patch but I"m pretty sure it won't work in all situation. The verbose option is handled in a very special way and we had to make some ugly hacks to make it work well. This probably breaks with this change.

@javiereguiluz
Copy link
Member Author

Your concerns look reasonable. Let's close this PR and let's close #10487 as "won't fix". Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants