From 3f0c4cee940d550cf7543eef188b3b068df8b818 Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Mon, 22 Jul 2024 17:14:55 -0400 Subject: BaseTools/GetMaintainer.py: Add GitHub username argument Adds a new `-g` parameter so that output will also include the GitHub username. This change uses a simple regular expression as opposed to directly returning the original line from the file to make the extraction of GitHub usernames more robust to other changes on the line in the maintainers text file. Signed-off-by: Michael Kubacki --- BaseTools/Scripts/GetMaintainer.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'BaseTools') diff --git a/BaseTools/Scripts/GetMaintainer.py b/BaseTools/Scripts/GetMaintainer.py index 8097ba4e7b..986550c4a9 100644 --- a/BaseTools/Scripts/GetMaintainer.py +++ b/BaseTools/Scripts/GetMaintainer.py @@ -179,6 +179,10 @@ if __name__ == '__main__': PARSER.add_argument('-l', '--lookup', help='Find section matches for path LOOKUP', required=False) + PARSER.add_argument('-g', '--github', + action='store_true', + help='Include GitHub usernames in output', + required=False) ARGS = PARSER.parse_args() REPO = SetupGit.locate_repo() @@ -203,5 +207,8 @@ if __name__ == '__main__': for address in ADDRESSES: if '<' in address and '>' in address: - address = address.split('>', 1)[0] + '>' - print(' %s' % address) + address, github_id = address.split('>', 1) + address = address + '>' + github_id = github_id.strip() if ARGS.github else '' + + print(' %s %s' % (address, github_id)) -- cgit v1.2.3