[PATCH v8 2/6] contrib: related: add option parsing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
---
 contrib/related/git-related | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/contrib/related/git-related b/contrib/related/git-related
index 1b9b1e7..bde5b99 100755
--- a/contrib/related/git-related
+++ b/contrib/related/git-related
@@ -3,9 +3,25 @@
 # This script finds people that might be interested in a patch
 # usage: git related <file>
 
+require 'optparse'
+
 $since = '5-years-ago'
 $min_percent = 10
 
+OptionParser.new do |opts|
+  opts.program_name = 'git related'
+  opts.banner = 'usage: git related [options] <file>'
+
+  opts.on('-p', '--min-percent N', Integer,
+          'Minium percentage of role participation') do |v|
+    $min_percent = v
+  end
+  opts.on('-d', '--since DATE',
+          'How far back to search for relevant commits') do |v|
+    $since = v
+  end
+end.parse!
+
 class Commit
 
   attr_reader :persons
-- 
1.8.3.358.g5a91d05

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]