Module: Mwc::Utils::CommandRegistry::ClassMethods
- Defined in:
- lib/mwc/utils/command_registry.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#add_command(command) ⇒ Object
private
Add command to thor.
-
#add_subcommand(command) ⇒ Object
private
Add subcommand to thor.
Instance Method Details
#add_command(command) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Add command to thor
20 21 22 23 24 25 26 27 28 |
# File 'lib/mwc/utils/command_registry.rb', line 20 def add_command(command) return unless command.display? command..each { |args| method_option(*args) } register command, command.name, command.usage, command.description end |
#add_subcommand(command) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Add subcommand to thor
36 37 38 39 40 41 |
# File 'lib/mwc/utils/command_registry.rb', line 36 def add_subcommand(command) return unless command.display? desc command.usage, command.description subcommand command.name, command end |