Class: Tane::Commands::Help

Inherits:
Base
  • Object
show all
Defined in:
lib/tane/commands/help.rb

Class Method Summary collapse

Methods inherited from Base

fire

Methods included from Helpers

included

Class Method Details

.help_for_command(command) ⇒ Object



12
13
14
15
16
# File 'lib/tane/commands/help.rb', line 12

def help_for_command(command)
  klass = Tane::Commands.const_get(command)
  Tane::Commands.const_missing(command) if not klass.respond_to? :help_text
  term.say "\n#{klass.help_text}\n"
end

.help_textObject



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/tane/commands/help.rb', line 18

def help_text
  <<-EOL
Usage:

tane help [command]

Displays the help message with the list commands tane supports. For details about usage about each each command use `tane help name`, where _name_ is the name of the command you need information about. For example

tane help support
  
displays the information about the support command.
EOL
end

.process(args) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/tane/commands/help.rb', line 4

def process(args)
  if args.count == 0
    puts opts.help_text
    return
  end
  help_for_command args.first.capitalize if args.count != 0
end