Method: Inspec::InspecCLI#detect

Defined in:
lib/inspec/cli.rb

#detectObject



276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
# File 'lib/inspec/cli.rb', line 276

def detect
  o = config
  o[:command] = 'platform.params'
  (_, res) = run_command(o)
  if o['format'] == 'json'
    puts res.to_json
  else
    headline('Platform Details')
    puts Inspec::BaseCLI.format_platform_info(params: res, indent: 0, color: 36)
  end
rescue ArgumentError, RuntimeError, Train::UserError => e
  $stderr.puts e.message
  exit 1
rescue StandardError => e
  pretty_handle_exception(e)
end