Method: Inspec::InspecCLI#detect

Defined in:
lib/inspec/cli.rb

#detectObject



137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/inspec/cli.rb', line 137

def detect
  o = opts.dup
  o[:command] = 'os.params'
  res = run_command(o)
  if opts['format'] == 'json'
    puts res.to_json
  else
    headline('Operating System Details')
    %w{name family release arch}.each { |item|
      puts format('%-10s %s', item.to_s.capitalize + ':',
                  mark_text(res[item.to_sym]))
    }
  end
end