Permalink
Browse files

Add depth option to executable

  • Loading branch information...
1 parent e189242 commit 9ed48bac3d123d883f04634ef2fa8fc55aefa20b @markmcspadden markmcspadden committed Dec 15, 2011
Showing with 9 additions and 1 deletion.
  1. +9 −1 bin/bugspots
View
@@ -11,11 +11,19 @@ ARGV << '--help' if ARGV.empty?
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: bugspots /path/to/git/repo"
+
+ # Option: Set Depth
+ opts.on('-d', '--depth [depth]', 'depth of log crawl (integer)') do |d|
+ options[:depth] = d.to_i
+ end
end.parse!
+# Set a reasonable default of depth
+options[:depth] ||= 500
+
puts "Scanning #{ARGV[0]} repo".foreground(:green)
-fixes, spots = Bugspots.scan(ARGV[0])
+fixes, spots = Bugspots.scan(ARGV[0], options[:depth])
puts "\tFound #{fixes.size} bugfix commits, with #{spots.size} hotspots:".foreground(:yellow)
puts

0 comments on commit 9ed48ba

Please sign in to comment.