Method: Rodish::DSL#options
- Defined in:
- lib/rodish/dsl.rb
#options(banner, key: nil, &block) ⇒ Object
Set the option parser for the command to based on the provided block, which is executed in the context of a new instance of Rodish::OptionParser. These options are parsed for execuction of both subcommands and the current command.
The banner argument is required and sets the usage string for the command.
If key is given, parsed options will be placed in a subhash using that key.
49 50 51 52 53 |
# File 'lib/rodish/dsl.rb', line 49 def (, key: nil, &block) @command. = @command.option_key = key @command.option_parser = create_option_parser(&block) end |