Hi,

On Wed, Feb 19, 2014 at 08:54:30PM +0100, Lucas Nussbaum wrote:
> How about making it -s/--seen and -a/--all (for all packages)?
> 
> I agree that breaking the options is not very nice, but it doesn't sound
> like a critical breakage.

I tried -s/--seen, but since the documentation already referred to new
opportunities, I ended up going with -o/--old instead.  I've attached
a patch series that fixes a typo, renames the current -a/--all, and
then adds a new -a/--all.

-- 
Matt
>From 6fd676e033d40418a1ea17b442acd5eadd8ba16d Mon Sep 17 00:00:00 2001
From: Matt Kraai <kr...@ftbfs.org>
Date: Wed, 19 Feb 2014 12:34:59 -0800
Subject: [PATCH 1/3] Remove an extra asterisk

---
 how-can-i-help.1     |    2 +-
 how-can-i-help.1.txt |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/how-can-i-help.1 b/how-can-i-help.1
index b4df918..950fa12 100644
--- a/how-can-i-help.1
+++ b/how-can-i-help.1
@@ -46,7 +46,7 @@ Show some help\&.
 .PP
 \fB\-a\fR, \fB\-\-all\fR
 .RS 4
-Show all opportunities for contribution\&. *
+Show all opportunities for contribution\&.
 .RE
 .PP
 \fB\-q\fR, \fB\-\-quiet\fR
diff --git a/how-can-i-help.1.txt b/how-can-i-help.1.txt
index 45a9e5e..d3248e0 100644
--- a/how-can-i-help.1.txt
+++ b/how-can-i-help.1.txt
@@ -26,7 +26,7 @@ Options must come before the other command line arguments.
 
 *-a*, *--all*::
   Show all opportunities for contribution.
-*
+
 *-q*, *--quiet*::
   Do not display header and footer.
 
-- 
1.7.10.4

>From 34fa1fa54910502d5000f0409cac7ebcaaa16542 Mon Sep 17 00:00:00 2001
From: Matt Kraai <kr...@ftbfs.org>
Date: Wed, 19 Feb 2014 12:47:13 -0800
Subject: [PATCH 2/3] Rename --all to --old

---
 bin/how-can-i-help   |   24 ++++++++++++------------
 how-can-i-help.1     |    6 +++---
 how-can-i-help.1.txt |    6 +++---
 3 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/bin/how-can-i-help b/bin/how-can-i-help
index 987cf8e..eb7beb3 100755
--- a/bin/how-can-i-help
+++ b/bin/how-can-i-help
@@ -38,7 +38,7 @@ ENV['LC_ALL'] = 'C.UTF-8'
 include Debian
 
 $quiet = false
-$all = false
+$old = false
 $proxy_url = ENV["HTTP_PROXY"] || ENV["http_proxy"]
 
 optparse = OptionParser.new do |opts|
@@ -52,8 +52,8 @@ optparse = OptionParser.new do |opts|
     exit(0)
   end
 
-  opts.on('-a', '--all', 'show all opportunities for contribution') do
-    $all = true
+  opts.on('-o', '--old', 'show old opportunities for contribution') do
+    $old = true
   end
 
   opts.on('-q', '--quiet', 'do not display header and footer') do
@@ -123,7 +123,7 @@ end
 
 helpitems_filtered = []
 helpitems.each do |hi|
-  next if (not $all) and seen.include?(hi['hash'])
+  next if (not $old) and seen.include?(hi['hash'])
   if hi['type'] == 'wnpp'
     if packages & hi['packages'] != []
       helpitems_filtered << hi
@@ -183,7 +183,7 @@ def wnppcompare(a, b)
 end
 
 if wnpp.length > 0
-  puts $all ? 'Packages where help is needed, including orphaned ones (from WNPP):' : 'New packages where help is needed, including orphaned ones (from WNPP):'
+  puts $old ? 'Packages where help is needed, including orphaned ones (from WNPP):' : 'New packages where help is needed, including orphaned ones (from WNPP):'
   wnpp.sort { |a, b| wnppcompare(a,b) }.each do |r|
     puts " - #{r['source']} - http://bugs.debian.org/#{r['wnppbug']} - #{wnpptype(r['wnpptype'])}"
   end
@@ -191,7 +191,7 @@ if wnpp.length > 0
 end
 
 if gift.length > 0
-  puts $all ? 'Bugs suitable for new contributors (tagged \'gift\'):' : 'New bugs suitable for new contributors (tagged \'gift\'):'
+  puts $old ? 'Bugs suitable for new contributors (tagged \'gift\'):' : 'New bugs suitable for new contributors (tagged \'gift\'):'
   gift.sort { |a, b| [a['package'], a['bug'] ] <=> [ b['package'], b['bug'] ] }.each do |r|
     puts " - #{r['package']} - http://bugs.debian.org/#{r['bug']} - #{r['title']}"
   end
@@ -199,7 +199,7 @@ if gift.length > 0
 end
 
 if notesting.length > 0
-  puts $all ? 'Packages removed from Debian \'testing\' (the maintainer might need help):' : 'New packages removed from Debian \'testing\' (the maintainer might need help):'
+  puts $old ? 'Packages removed from Debian \'testing\' (the maintainer might need help):' : 'New packages removed from Debian \'testing\' (the maintainer might need help):'
   notesting.sort { |a, b| a['source'] <=> b['source'] }.each do |r|
     puts " - #{r['package']} - http://packages.qa.debian.org/#{r['source']}"
   end
@@ -207,7 +207,7 @@ if notesting.length > 0
 end
 
 if autoremoval.length > 0
-  puts $all ? 'Packages going to be removed from Debian \'testing\' (the maintainer might need help):' : 'New packages going to be removed from Debian \'testing\' (the maintainer might need help):'
+  puts $old ? 'Packages going to be removed from Debian \'testing\' (the maintainer might need help):' : 'New packages going to be removed from Debian \'testing\' (the maintainer might need help):'
   autoremoval.sort { |a, b| a['source'] <=> b['source'] }.each do |r|
     bugs = r['bugs'].map { |b| "##{b}" }
     if bugs.count == 0
@@ -223,18 +223,18 @@ if autoremoval.length > 0
 end
 
 if rfs.length > 0
-  puts $all ? 'Packages waiting for sponsorship (reviews/tests are also useful):' : 'New packages waiting for sponsorship (reviews/tests are also useful):'
+  puts $old ? 'Packages waiting for sponsorship (reviews/tests are also useful):' : 'New packages waiting for sponsorship (reviews/tests are also useful):'
   rfs.sort { |a, b| a['source'] <=> b['source'] }.each do |r|
     puts " - #{r['source']} - http://bugs.debian.org/#{r['id']} - #{r['title']}"
   end
   puts
 end
 
-if not $all and not $quiet
-  puts "------  Show all opportunities, not just new ones: how-can-i-help --all  ------"
+if not $old and not $quiet
+  puts "-----  Show old opportunities as well as new ones: how-can-i-help --old  -----"
 end
 
-if not $all
+if not $old
   seen = helpitems.map { |hi| hi['hash'] } & seen
   seen = seen + helpitems_filtered.map { |hi| hi['hash'] }
   File::open(SEEN_LOCAL, 'w') do |fd|
diff --git a/how-can-i-help.1 b/how-can-i-help.1
index 950fa12..156b26f 100644
--- a/how-can-i-help.1
+++ b/how-can-i-help.1
@@ -31,7 +31,7 @@
 how-can-i-help \- show opportunities for contributing to Debian
 .SH "SYNOPSIS"
 .sp
-\fBhow\-can\-i\-help\fR [\fI\-ahq\fR] [\fI\-\-help\fR] [\fI\-\-all\fR] [\fI\-\-quiet\fR]
+\fBhow\-can\-i\-help\fR [\fI\-hoq\fR] [\fI\-\-help\fR] [\fI\-\-old\fR] [\fI\-\-quiet\fR]
 .SH "DESCRIPTION"
 .sp
 \fBhow\-can\-i\-help\fR hooks into APT to list opportunities for contributions to Debian (orphaned packages, bugs tagged \fIgift\fR) for packages installed locally, after each APT invocation\&. It can also be invoked directly, and then lists all opportunities for contribution (not just the new ones)\&.
@@ -44,9 +44,9 @@ Options must come before the other command line arguments\&.
 Show some help\&.
 .RE
 .PP
-\fB\-a\fR, \fB\-\-all\fR
+\fB\-o\fR, \fB\-\-old\fR
 .RS 4
-Show all opportunities for contribution\&.
+Show old opportunities for contribution as well as new ones\&.
 .RE
 .PP
 \fB\-q\fR, \fB\-\-quiet\fR
diff --git a/how-can-i-help.1.txt b/how-can-i-help.1.txt
index d3248e0..bff6857 100644
--- a/how-can-i-help.1.txt
+++ b/how-can-i-help.1.txt
@@ -8,7 +8,7 @@ how-can-i-help - show opportunities for contributing to Debian
 
 SYNOPSIS
 --------
-*how-can-i-help* ['-ahq'] ['--help'] ['--all'] ['--quiet']
+*how-can-i-help* ['-hoq'] ['--help'] ['--old'] ['--quiet']
 
 DESCRIPTION
 -----------
@@ -24,8 +24,8 @@ Options must come before the other command line arguments.
 *-h*, *--help*::
   Show some help.
 
-*-a*, *--all*::
-  Show all opportunities for contribution.
+*-o*, *--old*::
+  Show old opportunities for contribution as well as new ones.
 
 *-q*, *--quiet*::
   Do not display header and footer.
-- 
1.7.10.4

>From fd39c15ebc3a899ee01d893440880d7d92399084 Mon Sep 17 00:00:00 2001
From: Matt Kraai <kr...@ftbfs.org>
Date: Wed, 19 Feb 2014 13:09:19 -0800
Subject: [PATCH 3/3] Add an option to show opportunities for all packages

---
 bin/how-can-i-help   |   10 +++++++++-
 how-can-i-help.1     |    7 ++++++-
 how-can-i-help.1.txt |    5 ++++-
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/bin/how-can-i-help b/bin/how-can-i-help
index eb7beb3..77bddf2 100755
--- a/bin/how-can-i-help
+++ b/bin/how-can-i-help
@@ -38,6 +38,7 @@ ENV['LC_ALL'] = 'C.UTF-8'
 include Debian
 
 $quiet = false
+$all = false
 $old = false
 $proxy_url = ENV["HTTP_PROXY"] || ENV["http_proxy"]
 
@@ -52,6 +53,11 @@ optparse = OptionParser.new do |opts|
     exit(0)
   end
 
+  opts.on('-a', '--all',
+          'show opportunities for contribution to all packages') do
+    $all = true
+  end
+
   opts.on('-o', '--old', 'show old opportunities for contribution') do
     $old = true
   end
@@ -124,7 +130,9 @@ end
 helpitems_filtered = []
 helpitems.each do |hi|
   next if (not $old) and seen.include?(hi['hash'])
-  if hi['type'] == 'wnpp'
+  if $all
+    helpitems_filtered << hi
+  elsif hi['type'] == 'wnpp'
     if packages & hi['packages'] != []
       helpitems_filtered << hi
     end
diff --git a/how-can-i-help.1 b/how-can-i-help.1
index 156b26f..c3da477 100644
--- a/how-can-i-help.1
+++ b/how-can-i-help.1
@@ -31,7 +31,7 @@
 how-can-i-help \- show opportunities for contributing to Debian
 .SH "SYNOPSIS"
 .sp
-\fBhow\-can\-i\-help\fR [\fI\-hoq\fR] [\fI\-\-help\fR] [\fI\-\-old\fR] [\fI\-\-quiet\fR]
+\fBhow\-can\-i\-help\fR [\fI\-ahoq\fR] [\fI\-\-help\fR] [\fI\-\-all\fR] [\fI\-\-old\fR] [\fI\-\-quiet\fR]
 .SH "DESCRIPTION"
 .sp
 \fBhow\-can\-i\-help\fR hooks into APT to list opportunities for contributions to Debian (orphaned packages, bugs tagged \fIgift\fR) for packages installed locally, after each APT invocation\&. It can also be invoked directly, and then lists all opportunities for contribution (not just the new ones)\&.
@@ -44,6 +44,11 @@ Options must come before the other command line arguments\&.
 Show some help\&.
 .RE
 .PP
+\fB\-a\fR, \fB\-\-all\fR
+.RS 4
+Show opportunities for contribution to all packages\&.
+.RE
+.PP
 \fB\-o\fR, \fB\-\-old\fR
 .RS 4
 Show old opportunities for contribution as well as new ones\&.
diff --git a/how-can-i-help.1.txt b/how-can-i-help.1.txt
index bff6857..cb2acbe 100644
--- a/how-can-i-help.1.txt
+++ b/how-can-i-help.1.txt
@@ -8,7 +8,7 @@ how-can-i-help - show opportunities for contributing to Debian
 
 SYNOPSIS
 --------
-*how-can-i-help* ['-hoq'] ['--help'] ['--old'] ['--quiet']
+*how-can-i-help* ['-ahoq'] ['--help'] ['--all'] ['--old'] ['--quiet']
 
 DESCRIPTION
 -----------
@@ -24,6 +24,9 @@ Options must come before the other command line arguments.
 *-h*, *--help*::
   Show some help.
 
+*-a*, *--all*::
+  Show opportunities for contribution to all packages.
+
 *-o*, *--old*::
   Show old opportunities for contribution as well as new ones.
 
-- 
1.7.10.4

Reply via email to