injekt/slop — Issue #41: Default not getting set depending on order of options.
Author: budu
Created: 2011-12-10 23:54:59+00:00
State: open

With the following script:

````
slop = Slop.parse do
on :d, :dev, 'Development-mode'
on :s, :server, 'Start server', default: 3000
end

puts slop.to_hash.inspect
````

Depending on order of options, the default value for the `-s` option doesn't get set, ex.:

````
$ test -s
{:dev => nil, :server => 3000}
````

````
$ test -d -s
{:dev => true, :server => 3000}
````

````
$ test -s -d
{:dev => true, :server => 0}
````

This seems to be caused by the second option used as the value of the first.

Also when grouping options, the default never get set:

````
$ test -sd
{:dev => true, :server => 0}
````

````
$ test -ds
{:dev => true, :server => 0}
````