Method: Inspec::InspecCLI#shell_func
- Defined in:
- lib/inspec/cli.rb
#shell_func ⇒ Object
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/inspec/cli.rb', line 156 def shell_func diagnose o = opts.dup o[:logger] = Logger.new(STDOUT) o[:logger].level = get_log_level(o.log_level) if o[:command].nil? runner = Inspec::Runner.new(o) return Inspec::Shell.new(runner).start else res = run_command(o) jres = res.respond_to?(:to_json) ? res.to_json : JSON.dump(res) puts jres end rescue RuntimeError, Train::UserError => e $stderr.puts e. end |