davetron5000 / optparse-plus

Start your command line scripts off right in Ruby
http://davetron5000.github.com/optparse-plus
Apache License 2.0
520 stars 54 forks source link

Methadone::Main#description sometimes fails #65

Closed ruafozy closed 11 years ago

ruafozy commented 11 years ago

Given

Suppose I give these commands:

cd /tmp
methadone --license mit rabbit
cd rabbit
vi bin/rabbit

When I edit the executable, what I do is insert a call to description, just before the call to "main".

When

I execute this command:

ruby -I lib bin/rabbit --help 

Then

I get exactly this output:

/usr/local/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/methadone-1.2.6/lib/methadone/main.rb:250:in `description': undefined method `description' for nil:NilClass (NoMethodError)
        from bin/rabbit:11:in `<class:App>'
        from bin/rabbit:7:in `<main>'

Tentative conclusion

description doesn't work unless one calls some other method of Methadone::Main first.