dannypurcell / rubycom

Turn your library into a command-line app by simply including Rubycom.
http://dannypurcell.github.io/rubycom/
MIT License
5 stars 0 forks source link

parameter is nil when single dash argument provided #27

Open dannypurcell opened 8 years ago

dannypurcell commented 8 years ago

For some reason a method with a non-defaulted parameter on the end receives nil when a single dash is given for the last argument on the command line.

Example:

def test(a, b, c)
  puts "a=#{a}, b=#{b}, c=#{c}"
end

Command Line:

test 1 2 -

Expected:

"a=1, b=2, c=-"

Actual:

"a=1, b=2, c=nil"