diff options
author | Will Woods <wwoods@redhat.com> | 2007-09-17 12:59:24 -0400 |
---|---|---|
committer | Will Woods <wwoods@redhat.com> | 2007-09-17 12:59:24 -0400 |
commit | c2f39678b16c9b9ec79b23a828bfadca86f47367 (patch) | |
tree | a23e6bcef29a946a0f4c40e899175ebc497d0f51 | |
parent | c5768850e598fce9877355bf87f0c859a3ff73d1 (diff) | |
download | python-bugzilla-c2f39678b16c9b9ec79b23a828bfadca86f47367.tar.gz python-bugzilla-c2f39678b16c9b9ec79b23a828bfadca86f47367.tar.xz python-bugzilla-c2f39678b16c9b9ec79b23a828bfadca86f47367.zip |
--full and --ids now overwrite each other (last one used wins)
-rwxr-xr-x | bugzilla | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -66,11 +66,10 @@ def modify_parser(parser,action): 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', - help="Give full bug info") - p.add_option('-i','--ids',action='store_true', - help="Just list bug IDs") + p.add_option('-f','--full',action='store_const',dest='output', + const='full',default='normal',help="Give full bug info") + p.add_option('-i','--ids',action='store_const',dest='output', + const='ids',help="Just list bug IDs") elif action == 'info': p.add_option('-p','--products',action='store_true', help='Get a list of products') @@ -153,19 +152,21 @@ if __name__ == '__main__': q[a] = i buglist = bz.query(q) - if opt.ids: + if opt.output == 'ids': for b in buglist: print b.bug_id - elif not opt.full: - for b in buglist: - print b - else: + elif opt.output == 'full': fullbuglist = bz.getbugs([b.bug_id for b in buglist]) for b in fullbuglist: print b print "CC: %s" % b.cc for c in b.longdescs: - print "* %s - %s (%s):\n %s\n" % (c['time'],c['name'],c['email'] or c['safe_email'],c['body']) + print "* %s - %s (%s):\n%s\n" % (c['time'],c['name'],c['email'] or c['safe_email'],c['body']) + elif opt.output == 'normal': + for b in buglist: + print b + else: + parser.error("opt.output was set to something weird.") else: print "Sorry - '%s' not implemented yet." % action |