symfony/symfony — pull request #11883 by ocke (2014-09-08 23:35:07+00:00)
Title: Possible solution to 3 state long options

A three state long option, instead of the current 2 state version:
- Not setting the longoption will make the default set to false, just like a standard longoption.
- Setting the longoption without a value will set it to it's default
- Setting the longoption with a value will set it to that value.

Let's say --dev
```
php tool.php
array(1) {
'dev' =>
bool(false)
}
php tool.php --dev
array(1) {
'dev' =>
'the default value'
}
php tool.php --dev=test
array(1) {
'dev' =>
'test'
}
```

A couple of notes:
- I assume you guys agree that it's not a good idea to break current functionality. Therefor VALUE_OPTIONAL will stay how it is and I added a new constant: VALUE_OPTIONULL.
- All the tests still work!
- We need to come up with a better name.
- I'll need to write new test for the new config option (VALUE_OPTIONULL).