Codegyre/Robo — pull request #47 by pfaocle (2014-07-07 20:50:55+00:00)
Title: If no value for an option is provided, assume it's a VALUE_NONE option.

Very quickly knocked this together and it's very untested, but I was curious why options without values (e.g.) `--silent` didn't work as expected:

```
$ robo drupal:magic /my/path
array(8) {
["nuke"]=>
bool(false)
...
```

```
robo drupal:magic /my/path --nuke
array(8) {
["nuke"]=>
bool(false)
...
```

```
robo drupal:magic /my/path --nuke=true
array(8) {
["nuke"]=>
string(4) "true"
...
```

There is no checking to see if the option _should_ have a value and has been accidentally omitted (an obvious improvement to this PR), but this change makes no-value options (i.e. booleans) work as expected, IMO:

```
$ robo drupal:magic /my/path
array(8) {
["nuke"]=>
bool(false)
...
```

```
robo drupal:magic /my/path --nuke
array(8) {
["nuke"]=>
bool(true)
...
```

```
robo drupal:magic /my/path --nuke=true
[RuntimeException]
The "--nonuke" option does not accept a value."
```

Note that we can still do `robo drupal:magic --anotheroption="that"`, if the option's default is a non-boolean:

```php
public function drupalMagic($path, $opts = ['nuke' => false, 'anotheroption' => 'this'])
{ ...
```

Any thoughts?