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 <phi...@redhat.com> --- BaseTools/Scripts/GetMaintainer.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/BaseTools/Scripts/GetMaintainer.py b/BaseTools/Scripts/GetMaintainer.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__ == '__main__': PARSER = argparse.ArgumentParser( description='Retrieves information on who to cc for review on a given commit') + PARSER.add_argument('-q', '--quiet', + action="store_true", + help='Quiet mode, useful when piping the output to a script', + required=False) PARSER.add_argument('commit', action="store", help='git revision to examine (default: HEAD)', @@ -181,10 +185,11 @@ if __name__ == '__main__': ADDRESSES = [] for file in FILES: - print(file) + if not ARGS.quiet: + print(file) addresslist = get_maintainers(file, SECTIONS) if addresslist: ADDRESSES += addresslist for address in list(OrderedDict.fromkeys(ADDRESSES)): - print(' %s' % address) + print('%s%s' % ("" if ARGS.quiet else " ", address)) -- 2.21.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49106): https://edk2.groups.io/g/devel/message/49106 Mute This Topic: https://groups.io/mt/34560655/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-