For dynamic defaults.
Add callable defaults.
I think it would be better to do it like this:
options[key] = value.respond_to?(:call) ? value.call : value
Since both a lambda and a Proc respond to call (plus any other Object the user could create that responds to call as well
This seems like a good feature but could you please add tests?
+1 on this. I would like to configure defaults for certain parameters to be read from environment variables (in my case AWS credentials.)
While this works by simply doing :default => ENV['FOO'] it can't be unit tested because by the time tests run, the Thor class is already configured since it was done at load time.
:default => ENV['FOO']