Method: Inspec::InspecCLI#detect

Defined in:
lib/inspec/cli.rb

#detectObject



195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/inspec/cli.rb', line 195

def detect
  o = opts(:detect).dup
  o[:command] = 'platform.params'
  (_, res) = run_command(o)
  if o['format'] == 'json'
    puts res.to_json
  else
    headline('Platform Details')
    puts Inspec::BaseCLI.detect(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