diff options
author | Chris Ball <cjb@laptop.org> | 2009-06-25 13:44:27 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2009-06-25 13:44:27 -0400 |
commit | 34b2884112e3c3ca0cc0ac83df68c66f6b2729c4 (patch) | |
tree | 7a1f3589de72cf53cf33d815ac49ddd1fb2f5fd5 /becommands | |
parent | ae52bd5946df9c0d59be43824b20d33819891f93 (diff) | |
parent | 93402b914313e102aa56d5d59a2fead428ae8463 (diff) | |
download | bugseverywhere-34b2884112e3c3ca0cc0ac83df68c66f6b2729c4.tar.gz |
Merge be --version code from W. Trevor King.
Diffstat (limited to 'becommands')
-rw-r--r-- | becommands/list.py | 12 | ||||
-rw-r--r-- | becommands/tag.py | 3 |
2 files changed, 10 insertions, 5 deletions
diff --git a/becommands/list.py b/becommands/list.py index fa2f592..c397024 100644 --- a/becommands/list.py +++ b/becommands/list.py @@ -17,6 +17,7 @@ """List bugs""" from libbe import cmdutil, bugdir, bug import os +import re __desc__ = __doc__ # get a list of * for cmp_*() comparing two bugs. @@ -110,8 +111,8 @@ def execute(args, test=False): if target == []: # set the default value target = "all" if options.extra_strings != None: - required_extra_strings = options.extra_strings.split(',') - + extra_string_regexps = [re.compile(x) for x in options.extra_strings.split(',')] + def filter(bug): if status != "all" and not bug.status in status: return False @@ -122,9 +123,12 @@ def execute(args, test=False): if target != "all" and not bug.target in target: return False if options.extra_strings != None: + if len(bug.extra_strings) == 0 and len(extra_string_regexps) > 0: + return False for string in bug.extra_strings: - if string not in required_extra_strings: - return False + for regexp in extra_string_regexps: + if not regexp.match(string): + return False return True bugs = [b for b in bd if filter(b) ] diff --git a/becommands/tag.py b/becommands/tag.py index 2394284..5a18a7c 100644 --- a/becommands/tag.py +++ b/becommands/tag.py @@ -89,7 +89,8 @@ def execute(args, test=False): if tag not in tags: tags.append(tag) tags.sort() - print '\n'.join(tags) + if len(tags) > 0: + print '\n'.join(tags) return bug = bd.bug_from_shortname(args[0]) if len(args) == 2: |