Module: EacCli::RunnerWith::Help

Defined in:
lib/eac_cli/runner_with/help.rb,
lib/eac_cli/runner_with/help/layout.rb,
lib/eac_cli/runner_with/help/builder.rb,
lib/eac_cli/runner_with/help/builder/alternative.rb

Defined Under Namespace

Modules: Layout Classes: Builder

Instance Method Summary collapse

Instance Method Details

#help_join_sections(*sections) ⇒ String

Parameters:

  • items (Enumerable<String>)

Returns:

  • (String)


31
32
33
# File 'lib/eac_cli/runner_with/help.rb', line 31

def help_join_sections(*sections)
  ::EacCli::RunnerWith::Help::Layout.join_sections(*sections)
end

#help_list_section(title, items) ⇒ String

Parameters:

  • items (Enumerable<String>)

Returns:

  • (String)


25
26
27
# File 'lib/eac_cli/runner_with/help.rb', line 25

def help_list_section(title, items)
  ::EacCli::RunnerWith::Help::Layout.list_section(title, items)
end

#help_runObject



35
36
37
38
39
40
# File 'lib/eac_cli/runner_with/help.rb', line 35

def help_run
  return unless show_help?

  puts help_text
  raise ::EacCli::Runner::Exit
end

#help_textString

Returns:

  • (String)


43
44
45
# File 'lib/eac_cli/runner_with/help.rb', line 43

def help_text
  ::EacCli::RunnerWith::Help::Builder.new(self).to_s
end

#show_help?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/eac_cli/runner_with/help.rb', line 47

def show_help?
  parsed.help? && !if_respond(:run_subcommand?, false)
end