Module: Rip::Help

Included in:
Commands, Env
Defined in:
lib/rip/help.rb

Overview

tasty dsl for adding help text

Instance Method Summary collapse

Instance Method Details

#show_help(command, commands = commands) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/rip/help.rb', line 5

def show_help(command, commands = commands)
  subcommand = command.to_s.empty? ? nil : "#{command} "
  ui.puts "Usage: rip #{subcommand}COMMAND [options]", ""
  ui.puts "Commands available:"

  show_command_table begin
    commands.zip begin
      commands.map { |c| @help[c].first unless @help[c].nil? }
    end
  end
end