Skip to content

Commit

Permalink
+ Added --extended / -e to put file:line output on next line (for rub…
Browse files Browse the repository at this point in the history
…ymine & friends)

[git-p4: depot-paths = "//src/flog/dev/": change = 8989]
  • Loading branch information
zenspider committed Oct 18, 2013
1 parent 30bad3b commit d33a603
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/flog_cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ def self.parse_options args = ARGV
option[:quiet] = true
end

opts.on("-e", "--extended", "Put file:line on a separate line (for rubymine & friends).") do
option[:extended] = true
end

opts.on("-s", "--score", "Display total score only.") do
option[:score] = true
end
Expand Down Expand Up @@ -210,7 +214,9 @@ def output_details_grouped io, threshold = nil
def print_score io, name, score
location = method_locations[name]
if location then
io.puts "%8.1f: %-32s %s" % [score, name, location]
sep = " "
sep = "%-11s" % "\n" if option[:extended]
io.puts "%8.1f: %-32s%s%s" % [score, name, sep, location]
else
io.puts "%8.1f: %s" % [score, name]
end
Expand Down
2 changes: 2 additions & 0 deletions test/test_flog_cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def test_cls_parse_options
"--methods-only" => :methods,
"-q" => :quiet,
"--quiet" => :quiet,
"-e" => :extended,
"--extended" => :extended,
"-s" => :score,
"--score" => :score,
"-v" => :verbose,
Expand Down

0 comments on commit d33a603

Please sign in to comment.