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

Skip to content

[Console] Revert BC-break for verbose option value #9566

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

Merged
merged 2 commits into from
Nov 22, 2013

Conversation

chEbba
Copy link
Contributor

@chEbba chEbba commented Nov 22, 2013

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

Closes #9285


PR #8835 "fixed" the input value for verbosity option with VALUE_OPTIONAL. And syntax like

cli.php -v command
cli.php --verbose command

Is broken now, because ArgvInput tries to use argument as verbose value (#9285).
For now i added a test for this case and revert this changes.

@@ -601,6 +600,43 @@ public function testRun()
$this->assertSame('called'.PHP_EOL, $tester->getDisplay(), '->run() does not call interact() if -n is passed');
}

/**
* Issue #9285
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this, i think github has history for these things

@fabpot
Copy link
Member

fabpot commented Nov 22, 2013

Thanks you very much for your work on this one. Do you have any ETA for it to be mergeable (as this is a blocker for 2.4RC1)?

@chEbba
Copy link
Contributor Author

chEbba commented Nov 22, 2013

@fabpot The only one thing which stops the merge, is that there is a failing test for --verbose=X. And i dont see a good way how to fix it.
So there is few options:

  • Merge now and think what to do with this problem later.
  • Decide here how to resolve a problem, fix and then merge.

As for me the most acceptable decision is to remove this feature, but it should be done in 2.3, and 2.4 and low chance of user problems still exists if they rely to this option in ArrayInput (long verbose option value works for ArrayInput because it does not check that value is acceptable, and does not work for String or Argv because of this check).

So what can be done:

  • Remove all hacks like hasParameterOption('--verbose=3')
  • Remove tests for long option value
  • Add checks in ArrayInput for options without value

The another way is to add some more hacks to fix this support. But any change in this way have to be a hack, because option should stay to be VALUE_NONE

@fabpot
Copy link
Member

fabpot commented Nov 22, 2013

For 2.4, we just need to revert what was done to get the behavior of 2.3 (even if it was not perfect.) We will then have plenty of time to think about how to fix that in 2.5 (can you create a ticket about this?)

@chEbba
Copy link
Contributor Author

chEbba commented Nov 22, 2013

I removed test for long verbose option (to have passed tests in the current version). So now it can be merged, i will create a separate PR with this test and issue description.

@fabpot
Copy link
Member

fabpot commented Nov 22, 2013

@chEbba Looks like you forgot to push your code, no?

@chEbba
Copy link
Contributor Author

chEbba commented Nov 22, 2013

@fabpot Hm, I guess no. 2 commits one with BC test and the second one with changes revert. I removed the third one with test for long option value.
Tests are still failed, but as i see only on 5.3 in Stopwatch component.

fabpot added a commit that referenced this pull request Nov 22, 2013
This PR was merged into the master branch.

Discussion
----------

[Console] Revert BC-break for verbose option value

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

Closes #9285

----

PR #8835 "fixed" the input value for verbosity option with `VALUE_OPTIONAL`. And syntax like
```
cli.php -v command
cli.php --verbose command
```
Is broken now, because `ArgvInput` tries to use argument as verbose value (#9285).
For now i added a test for this case and revert this changes.

Commits
-------

432bbe1 [Console] Revert a28eb8 because of BC break
5e03e9a [Console] Add test for --verbose before argument
@fabpot fabpot merged commit 432bbe1 into symfony:master Nov 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Console] Optional verbose value messes up parsing of arguments
3 participants