Class: Jah::Cli

Inherits:
Object
  • Object
show all
Defined in:
lib/jah/cli.rb

Direct Known Subclasses

Install

Class Method Summary collapse

Class Method Details

.stop!Object



85
86
87
88
89
# File 'lib/jah/cli.rb', line 85

def self.stop!
  puts "Closing Jah..."
  Opt.closing_time!
  EM.stop
end

.work(argv) ⇒ Object



72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/jah/cli.rb', line 72

def self.work(argv)
  trap(:INT) { stop! }
  trap(:TERM) { stop! }

  Opt.autoload_config(parse_options(argv))

  if comm = argv.shift
    Jah::Agent.send(comm) #rescue puts "Command not found: #{comm} #{@usage}"
  else
    Opt.mode ? Jah::Agent.start : Install.new
  end
end