From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.groups.io with SMTP id smtpd.web12.5309.1571234993444935793 for ; Wed, 16 Oct 2019 07:09:53 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: philmd@redhat.com) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1C99151EE6; Wed, 16 Oct 2019 14:09:53 +0000 (UTC) Received: from x1w.redhat.com (unknown [10.40.205.172]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0755A5D6B2; Wed, 16 Oct 2019 14:09:50 +0000 (UTC) From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= To: Leif Lindholm , devel@edk2.groups.io Cc: Bob Feng , Liming Gao , Laszlo Ersek , Philippe Mathieu-Daude Subject: [PATCH 2/3] BaseTools: Add '--quiet' option to GetMaintainer.py script Date: Wed, 16 Oct 2019 16:09:39 +0200 Message-Id: <20191016140940.18844-3-philmd@redhat.com> In-Reply-To: <20191016140940.18844-1-philmd@redhat.com> References: <20191016140940.18844-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 16 Oct 2019 14:09:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable To have GetMaintainer.py script output easily parsable by scripts, add the '--quiet' option. Output will be formatted as one email per line. Signed-off-by: Philippe Mathieu-Daude --- BaseTools/Scripts/GetMaintainer.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/BaseTools/Scripts/GetMaintainer.py b/BaseTools/Scripts/GetMa= intainer.py index fbc63522db77..f26f2c5ba584 100755 --- a/BaseTools/Scripts/GetMaintainer.py +++ b/BaseTools/Scripts/GetMaintainer.py @@ -157,6 +157,10 @@ def get_modified_files(repo, args): if __name__ =3D=3D '__main__': PARSER =3D argparse.ArgumentParser( description=3D'Retrieves information on who to cc for review on = a given commit') + PARSER.add_argument('-q', '--quiet', + action=3D"store_true", + help=3D'Quiet mode, useful when piping the outpu= t to a script', + required=3DFalse) PARSER.add_argument('commit', action=3D"store", help=3D'git revision to examine (default: HEAD)'= , @@ -181,10 +185,11 @@ if __name__ =3D=3D '__main__': ADDRESSES =3D [] =20 for file in FILES: - print(file) + if not ARGS.quiet: + print(file) addresslist =3D get_maintainers(file, SECTIONS) if addresslist: ADDRESSES +=3D addresslist =20 for address in list(OrderedDict.fromkeys(ADDRESSES)): - print(' %s' % address) + print('%s%s' % ("" if ARGS.quiet else " ", address)) --=20 2.21.0