Class: WhirledPeas::Command::Help

Inherits:
Base
  • Object
show all
Defined in:
lib/whirled_peas/command/help.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.descriptionObject



6
7
8
# File 'lib/whirled_peas/command/help.rb', line 6

def self.description
  'Show detailed help for a command'
end

Instance Method Details

#startObject



10
11
12
13
14
15
16
17
# File 'lib/whirled_peas/command/help.rb', line 10

def start
  class_name = cmd.split('_').map(&:capitalize).join
  klass = Command.const_get(class_name)
  klass.print_usage
rescue NameError
  puts "Unrecognized command: #{cmd}"
  exit(1)
end