bin/brakeman in brakeman-3.5.0 vs bin/brakeman in brakeman-3.6.0

- old
+ new

@@ -8,11 +8,11 @@ #Parse options begin options, parser = Brakeman::Options.parse! ARGV rescue OptionParser::ParseError => e - $stderr.puts e.message.capitalize + $stderr.puts e.message $stderr.puts "Please see `brakeman --help` for valid options" exit(-1) end #Exit early for these options @@ -87,9 +87,14 @@ #Return error code if --exit-on-warn is used and warnings were found if tracker.options[:exit_on_warn] and not tracker.filtered_warnings.empty? exit Brakeman::Warnings_Found_Exit_Code end + end + + #Return error code if --exit-on-error is used and errors were found + if tracker.options[:exit_on_error] and tracker.errors.any? + exit Brakeman::Errors_Found_Exit_Code end rescue Brakeman::NoApplication => e warn e.message exit Brakeman::No_App_Found_Exit_Code rescue Brakeman::MissingChecksError => e