add --only-team option

Change-Id: I1df59dfd024af020bd02848152296910f72c90b2
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2018-05-07 12:01:23 -04:00
parent d25e289732
commit f85ddd8f4d
1 changed files with 10 additions and 0 deletions

View File

@ -58,6 +58,12 @@ class ContributionsReportBase(lister.Lister):
action='append',
help='do not show stats for the named team (may be repeated)',
)
parser.add_argument(
'--only-team',
default=[],
action='append',
help='only show stats for the named team (may be repeated)',
)
parser.add_argument(
'--ignore-tag',
dest='ignore_tag',
@ -112,6 +118,10 @@ class ContributionsReportBase(lister.Lister):
if ignore_teams:
data = (d for d in data if d['Team'].lower() not in ignore_teams)
only_teams = set(t.lower() for t in parsed_args.only_team)
if only_teams:
data = (d for d in data if d['Team'].lower() in only_teams)
if parsed_args.only_sponsors:
sponsor_map = sponsors.Sponsors(parsed_args.sponsor_level)