From d05d1c81577978b2e4adf4c2d1ddfd0da183eca2 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Mon, 17 Sep 2007 11:49:50 -0400 Subject: Add cc, assigned_to, and bug_status - thanks Florian! --- bugzilla | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'bugzilla') diff --git a/bugzilla b/bugzilla index 04cd706..a06944b 100755 --- a/bugzilla +++ b/bugzilla @@ -56,8 +56,14 @@ def modify_parser(parser,action): help="search inside bug comments") p.add_option('-s','--short_desc', help="search bug summaries") + p.add_option('-o','--cc', + help="search cc lists for given address") + p.add_option('-a','--assigned_to', + help="search for bugs assigned to this address") p.add_option('-b','--bug_id', help="select an individual bug ID") + p.add_option('-t','--bug_status',default="NEW,VERIFIED,ASSIGNED,NEEDINFO,ON_DEV,FAILS_QA,REOPENED", + help="Comma-separated list of bug statuses to accept") # output modifiers # FIXME: these should overwrite each other: store_const in output_type p.add_option('-f','--full',action='store_true', @@ -121,11 +127,22 @@ if __name__ == '__main__': elif action == 'query': # Construct the query from the list of queryable options q = dict() - for a in ('product', 'component', 'version', 'long_desc', 'bug_id', 'short_desc'): + email_count = 1 + for a in ('product','component','version','long_desc','bug_id', + 'short_desc','cc','assigned_to','bug_status'): if hasattr(opt,a): i = getattr(opt,a) if i: - q[a] = i + if a in ('bug_status'): # list arguments go here + q[a] = i.split(',') + elif a in ('cc','assigned_to'): + # the email query fields are kind of weird. + # thanks to Florian La Roche for this bit. + q['email%i' % email_count] = i #email1: foo@bar.com + q['email%s%i' % (a,email_count)] = True #emailcc1: True + email_count = email_count + 1 + else: + q[a] = i buglist = bz.query(q) if opt.ids: -- cgit