davetron5000 / gli

Make awesome command-line applications the easy way
http://davetron5000.github.io/gli
Apache License 2.0
1.26k stars 102 forks source link

commands_from doesn't respect scope #279

Closed dblock closed 3 years ago

dblock commented 6 years ago

The implementation of commands_from is https://github.com/davetron5000/gli/blob/84c21131320168178077e9bfe03f51f0e28d361e/lib/gli/app.rb#L319 and is a simple require. If you call it from a class, it will create global scope, not local to where it was called from.

davetron5000 commented 6 years ago

I'm not sure how to solve this w/out breaking backwards compat, but you are correct in how it behaves