Class: Clin::HelpOptions

Inherits:
GeneralOption show all
Defined in:
lib/clin/common/help_options.rb

Overview

Then running you command with -h or –help will show the help menu

Instance Method Summary collapse

Methods inherited from CommandOptionsMixin

add_option, execute_general_options, flag_option, general_option, list_flag_option, list_option, opt_option, option, register_options, remove_general_option

Constructor Details

#initialize(raise: true) ⇒ HelpOptions

Returns a new instance of HelpOptions.



16
17
18
# File 'lib/clin/common/help_options.rb', line 16

def initialize(raise: true)
  @raise = raise
end

Instance Method Details

#execute(options) ⇒ Object



20
21
22
23
# File 'lib/clin/common/help_options.rb', line 20

def execute(options)
  return unless @raise
  fail Clin::HelpError, options[:help] if options[:help]
end