提交 915dfaed 编写于 作者: J Justin

Merge pull request #387 from ssendev/patch-1

Add option to set table width limit in text output
......@@ -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)
......
......@@ -384,7 +384,9 @@ module Brakeman::Util
end
def truncate_table str
@terminal_width ||= if $stdin && $stdin.tty?
@terminal_width ||= if @tracker.options[:table_width]
@tracker.options[:table_width]
elsif $stdin && $stdin.tty?
Brakeman.load_brakeman_dependency 'highline'
::HighLine.new.terminal_size[0]
else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册