From f85ddd8f4d7cd64fb7e4d60dc6338be623f30450 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Mon, 7 May 2018 12:01:23 -0400 Subject: [PATCH] add --only-team option Change-Id: I1df59dfd024af020bd02848152296910f72c90b2 Signed-off-by: Doug Hellmann --- goal_tools/who_helped/report.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/goal_tools/who_helped/report.py b/goal_tools/who_helped/report.py index 71671f7..c13efd4 100644 --- a/goal_tools/who_helped/report.py +++ b/goal_tools/who_helped/report.py @@ -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)