rails / thor

Thor is a toolkit for building powerful command-line interfaces.
http://whatisthor.com/
MIT License
5.12k stars 553 forks source link

Add hash to list provided options for a method #748

Open ameir opened 3 years ago

ameir commented 3 years ago

When I have a method with many arguments and I want to pass on all the arguments, it would be handy if there were a method_options or such hash to make things simple.

I am instead doing the following to obtain this result:

cluster.apply((options.to_a - parent_options.to_a).to_h.transform_keys(&:to_sym))

This may already be supported, but I was unable to find a relevant result in documentation.