Method: Inspec::InspecCLI#exec

Defined in:
lib/inspec/cli.rb

#exec(*targets) ⇒ Object



289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
# File 'lib/inspec/cli.rb', line 289

def exec(*targets)
  o = config
  diagnose(o)
  configure_logger(o)

  runner = Inspec::Runner.new(o)
  targets.each { |target| runner.add_target(target) }

  exit runner.run
rescue ArgumentError, RuntimeError, Train::UserError => e
  $stderr.puts e.message
  exit 1
rescue StandardError => e
  pretty_handle_exception(e)
end