diff --git a/lib/brakeman.rb b/lib/brakeman.rb index 2262d6a824f11689ef7670c6be97f24f4635e6a3..6c64ca7c2abd5ebea42e624559111ffe31676fe4 100644 --- a/lib/brakeman.rb +++ b/lib/brakeman.rb @@ -41,6 +41,7 @@ module Brakeman # * :safe_methods - array of methods to consider safe # * :skip_libs - do not process lib/ directory (default: false) # * :skip_checks - checks not to run (run all if not specified) + # * :table_width - limit width of table in text report # * :absolute_paths - show absolute path of each file (default: false) # * :summary_only - only output summary section of report # (does not apply to tabs format) @@ -126,6 +127,7 @@ module Brakeman :ignore_redirect_to_model => true, :ignore_model_output => false, :message_limit => 100, + :table_width => 80, :parallel_checks => true, :relative_path => false, :report_progress => true, diff --git a/lib/brakeman/options.rb b/lib/brakeman/options.rb index ea295201321d5ba39470b32ef13d3136ed424f71..cf9772211f92379d80db8c30a3bd86f5b67e490f 100644 --- a/lib/brakeman/options.rb +++ b/lib/brakeman/options.rb @@ -177,6 +177,10 @@ module Brakeman::Options options[:message_limit] = limit.to_i end + opts.on "--table-width WIDTH", "Limit table width in text report" do |width| + options[:table_width] = width.to_i + end + opts.on "-o", "--output FILE", "Specify files for output. Defaults to stdout. Multiple '-o's allowed" do |file| options[:output_files] ||= [] options[:output_files].push(file) diff --git a/lib/brakeman/util.rb b/lib/brakeman/util.rb index 4070f7d95070150bc8d37c877f9c419bc7611cef..6ec11f982950cdf9da13ac5a38a20e7a4717cd6b 100644 --- a/lib/brakeman/util.rb +++ b/lib/brakeman/util.rb @@ -388,7 +388,7 @@ module Brakeman::Util Brakeman.load_brakeman_dependency 'highline' ::HighLine.new.terminal_size[0] else - @tracker.options[:message_limit] + @tracker.options[:table_width] end lines = str.lines