From ad2abd73625d5b307f7d503fbe9b3ee5238a9248 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Thu, 31 Jul 2008 21:19:38 -0700 Subject: [PATCH] accept status in addition to bugs in bug_filter --- Debbugs/Bugs.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Debbugs/Bugs.pm b/Debbugs/Bugs.pm index 20e2fb7..026fce6 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'); -- 2.39.2