summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2024-07-22 17:14:55 -0400
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-07-25 02:28:49 +0000
commit3f0c4cee940d550cf7543eef188b3b068df8b818 (patch)
tree52b52034a975ac9e25e580098323fa619efb2206
parenta96d2a8f2dd3eb7e32b383821fe30cfd7cdb2248 (diff)
downloadedk2-3f0c4cee940d550cf7543eef188b3b068df8b818.tar.gz
edk2-3f0c4cee940d550cf7543eef188b3b068df8b818.tar.bz2
edk2-3f0c4cee940d550cf7543eef188b3b068df8b818.zip
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 <michael.kubacki@microsoft.com>
-rw-r--r--BaseTools/Scripts/GetMaintainer.py11
1 files changed, 9 insertions, 2 deletions
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))