Method: ArgParser::CommandBlock#command
- Defined in:
- lib/arg-parser/definition.rb
#command(key, desc, opts = {}, &block) ⇒ Object
332 333 334 335 336 337 |
# File 'lib/arg-parser/definition.rb', line 332 def command(key, desc, opts = {}, &block) cmd_arg_scope = ArgumentScope.new("Arguments for #{key} command", @parent) cmd_arg_scope.instance_eval(&block) if block_given? cmd_inst = CommandInstance.new(key, desc, @command_arg, cmd_arg_scope, opts) @command_arg << cmd_inst end |