Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

+ Added --extended / -e to put file:line output on next line (for rub…

…ymine & friends)

[git-p4: depot-paths = "//src/flog/dev/": change = 8989]
  • Loading branch information...
commit d33a60349f98e5cd31d9f7ab8154759edccafd4a 1 parent 30bad3b
@zenspider zenspider authored
Showing with 9 additions and 1 deletion.
  1. +7 −1 lib/flog_cli.rb
  2. +2 −0  test/test_flog_cli.rb
View
8 lib/flog_cli.rb
@@ -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
@@ -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
View
2  test/test_flog_cli.rb
@@ -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,
Please sign in to comment.
Something went wrong with that request. Please try again.