Module: EventMachine::Wssh::Help

Defined in:
lib/em/wssh/help.rb

Constant Summary collapse

Title =
'Show this help'

Class Method Summary collapse

Class Method Details

.command(mod) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/em/wssh/help.rb', line 30

def self.command mod
  if mod.respond_to? :help
    mod.help
  else
    puts mod::Title
  end
end

.go!Object



8
9
10
11
12
13
14
# File 'lib/em/wssh/help.rb', line 8

def self.go!
  if mod = Exe.command?(ARGV.shift)
    command mod
  else
    top
  end
end

.helpObject



38
39
40
41
42
43
44
# File 'lib/em/wssh/help.rb', line 38

def self.help
  puts <<-EOT
Shows help for WSSH suite or individual commands

#{Exe.usage} [command]
  EOT
end

.topObject



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/em/wssh/help.rb', line 16

def self.top
  require_relative 'all'

  puts <<-EOT
WSSH suite v#{VERSION}

Usage: wssh command [parameters...]

Available commands:

  EOT
  Exe.commands.each{|cmd, mod| puts "  wssh #{cmd}\t#{mod::Title}"}
end