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

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.

Raises:



9
10
11
12
# File 'lib/cli/modular_options.rb', line 9

def cli_options( &block )
  raise ArgumentError, 'Block required but not given' unless block_given?
  (@cli_options_hooks ||= Array.new) << block
end