From: Don Armstrong <don@donarmstrong.com>
Date: Fri, 1 Aug 2008 04:19:38 +0000 (-0700)
Subject: accept status in addition to bugs in bug_filter
X-Git-Tag: release/2.6.0~488^2~23^2~5
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ad2abd73625d5b307f7d503fbe9b3ee5238a9248;p=debbugs.git

accept status in addition to bugs in bug_filter
---

diff --git a/Debbugs/Bugs.pm b/Debbugs/Bugs.pm
index 20e2fb76..026fce66 100644
--- a/Debbugs/Bugs.pm
+++ b/Debbugs/Bugs.pm
@@ -304,14 +304,16 @@ sub newest_bug {
 
 Allows filtering bugs on commonly used criteria
 
+
+
 =cut
 
 sub bug_filter {
      my %param = validate_with(params => \@_,
-			       spec   => {bug => {type  => SCALAR,
-						  regex => qr/^\d+$/,
-						 },
-					  status => {type => HASHREF,
+			       spec   => {bug    => {type => ARRAYREF|SCALAR,
+						     optional => 1,
+						    },
+					  status => {type => HASHREF|ARRAYREF,
 						     optional => 1,
 						    },
 					  seen_merged => {type => HASHREF,
@@ -339,6 +341,9 @@ sub bug_filter {
 	 not defined $param{seen_merged}) {
 	  croak "repeat_merged false requires seen_merged to be passed";
      }
+     if (not exists $param{bug} and not exists $param{status}) {
+	 croak "one of bug or status must be passed";
+     }
 
      if (not exists $param{status}) {
 	  my $location = getbuglocation($param{bug}, 'summary');