Class: OpsWalrus::Cli2

Inherits:
Object
  • Object
show all
Defined in:
lib/opswalrus/cli2.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Cli2

Returns a new instance of Cli2.



25
26
27
# File 'lib/opswalrus/cli2.rb', line 25

def initialize(app)
  @app = app
end

Class Method Details

.run(argv = ARGV) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/opswalrus/cli2.rb', line 14

def self.run(argv = ARGV)
  app = App.instance(Dir.pwd)
  app.set_local_hostname(ENV["OPSWALRUS_LOCAL_HOSTNAME"]) if ENV["OPSWALRUS_LOCAL_HOSTNAME"]

  command = CliCommand.new()
  command.parse(argv)
  exit_status = command.run(app)

  TTY::Exit.exit_with(exit_status)
end