You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor #9560 Add 2 solutions for the 'option with optional argument' problem (Jean85, javiereguiluz)
This PR was submitted for the 2.7 branch but it was merged into the 2.8 branch instead (closes#9560).
Discussion
----------
Add 2 solutions for the 'option with optional argument' problem
While working on facile-it/paraunit#121, I discovered a tricky case with the Console component: using an option with an optional argument seemed impossible! The doc said:
> There is nothing forbidding you to create a command with an option that optionally accepts a value. However, there is no way you can distinguish when the option was used without a value (command --language) or when it wasn't used at all (command). In both cases, the value retrieved for the option will be null.
This is NOT TRUE. I've found two possible solutions to this issue (one myself, one in symfony/symfony#11572 (comment)) and this PR introduces them in the docs. I've also moved around the two tips/cautions which were at the end of the article, because with my reword it seemed nicer to me.
Commits
-------
d3f254d Minor simplifications
1aad365 Minor reword
99f9e3f Simplify the explanation leaving just one solution
a05b002 Add 2 solutions for the 'option with optional argument' problem
0 commit comments