12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/jekyll/agent_audit/command.rb', line 12
def parse!(*arguments)
super
rescue OptionParser::ParseError => error
config = instance_variable_get(:@agent_audit_parse_config) || {}
if config["format"] == "json"
report = Jekyll::AgentAudit::Report.new(
complete: false, operational_error: true,
diagnostics: [{"code" => "invalid_options", "message" => error.message}]
)
$stdout.puts Jekyll::AgentAudit::Reporters::JSON.render(report)
else
warn "jekyll-agent-audit: #{error.message}"
end
exit 2
end
|