Class: RHC::HelpFormatter

Inherits:
Commander::HelpFormatter::Terminal
  • Object
show all
Defined in:
lib/rhc/help_formatter.rb

Instance Method Summary collapse

Instance Method Details

#renderObject



8
9
10
# File 'lib/rhc/help_formatter.rb', line 8

def render
  template(:help).result RunnerHelpBindings.new(@runner).get_binding
end

#render_command_syntax(command) ⇒ Object



11
12
13
# File 'lib/rhc/help_formatter.rb', line 11

def render_command_syntax command
  template(:command_syntax_help).result command.get_binding
end

#render_options(runner) ⇒ Object



14
15
16
# File 'lib/rhc/help_formatter.rb', line 14

def render_options runner
  template(:options_help).result RunnerHelpBindings.new(runner).get_binding
end

#template(name) ⇒ Object



5
6
7
# File 'lib/rhc/help_formatter.rb', line 5

def template(name)
  ERB.new(File.read(File.join(File.dirname(__FILE__), 'usage_templates', "#{name}.erb")), nil, '-')
end