|
12 | 12 | from __future__ import print_function
|
13 | 13 |
|
14 | 14 | import argparse
|
| 15 | +import itertools |
15 | 16 | import os
|
16 | 17 | import re
|
17 | 18 | import subprocess2
|
@@ -200,9 +201,13 @@ def main():
|
200 | 201 | '--ignore-dirty-tree', action='store_true',
|
201 | 202 | help='Roll anyways, even if there is a diff.')
|
202 | 203 | parser.add_argument(
|
203 |
| - '-r', '--reviewer', |
204 |
| - help='To specify multiple reviewers, use comma separated list, e.g. ' |
205 |
| - '-r joe,jane,john. Defaults to @chromium.org') |
| 204 | + '-r', |
| 205 | + '--reviewer', |
| 206 | + action='append', |
| 207 | + help= |
| 208 | + 'To specify multiple reviewers, either use a comma separated list, e.g. ' |
| 209 | + '-r joe,jane,john or provide the flag multiple times, e.g. ' |
| 210 | + '-r joe -r jane. Defaults to @chromium.org') |
206 | 211 | parser.add_argument('-b', '--bug', help='Associate a bug number to the roll')
|
207 | 212 | # It is important that --no-log continues to work, as it is used by
|
208 | 213 | # internal -> external rollers. Please do not remove or break it.
|
@@ -230,7 +235,7 @@ def main():
|
230 | 235 | 'Can\'t use multiple paths to roll simultaneously and --key')
|
231 | 236 | reviewers = None
|
232 | 237 | if args.reviewer:
|
233 |
| - reviewers = args.reviewer.split(',') |
| 238 | + reviewers = list(itertools.chain(*[r.split(',') for r in args.reviewer])) |
234 | 239 | for i, r in enumerate(reviewers):
|
235 | 240 | if not '@' in r:
|
236 | 241 | reviewers[i] = r + '@chromium.org'
|
|
0 commit comments