Class: Thor
- Inherits:
-
Object
- Object
- Thor
- Defined in:
- lib/thor_register_patch.rb
Overview
this is a patch to register subcommands in Thor. there’s a pull-request for this so it is only temporary until that is done
Class Method Summary collapse
Class Method Details
.register(klass, subcommand_name, usage, description, options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/thor_register_patch.rb', line 6 def register(klass, subcommand_name, usage, description, ={}) if klass <= Thor::Group desc usage, description, define_method(subcommand_name) { |*args| invoke klass } else desc usage, description, subcommand subcommand_name, klass end end |