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

Allow to pass the verbosity level to the --verbose long option. #23

Closed
wants to merge 1 commit into from

Conversation

pfrenssen
Copy link

The help text for the verbosity option mentions that it is possible to pass a value to set the verbosity level:

  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

However, when I try this I get an error message:

$ php application.php demo:greet Fabien --verbose=3

  [Symfony\Component\Console\Exception\RuntimeException]  
  The "--verbose" option does not accept a value.         

The -vvv option works fine, but the POSIX long option --verbose doesn't accept a value. This is clearly the intention since these values are being read in Application::configureIO():

            if ($input->hasParameterOption('-vvv', true) || $input->hasParameterOption('--verbose=3', true) || $input->getParameterOption('--verbose', false, true) === 3) {

The solution is to simply change the input option from VALUE_NONE to VALUE_OPTIONAL.

@javiereguiluz
Copy link
Member

Thanks for contributing this pull request. However, the repositories of individual Symfony Components are read-only, so pull requests are ignored. Please, submit this pull request to the main Symfony repository at https://github.com/symfony/symfony/pulls

Thank you!

@pfrenssen
Copy link
Author

I did not realize this, thanks for letting me know! I have made a new PR against the main repo: symfony/symfony#22875

@pfrenssen pfrenssen closed this May 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants