Module: CLI::WithOptions
- Defined in:
- lib/cli/modular_options.rb
Overview
Use ‘extend CLI::WithOptions’ to declare OptionParser configuration blocks in your module.
Instance Method Summary collapse
-
#cli_options(&block) ⇒ Object
Used to declare a proc that can be used to configure an instance of OptionParser with a class or module.
Instance Method Details
#cli_options(&block) ⇒ Object
Used to declare a proc that can be used to configure an instance of OptionParser with a class or module.
9 10 11 12 |
# File 'lib/cli/modular_options.rb', line 9 def ( &block ) raise ArgumentError, 'Block required but not given' unless block_given? ( ||= Array.new) << block end |