This adds a main() function to mklog.py (like e.g. check_GNU_style.py
has), which makes it easier to import and invoke from another python
script. This is useful when using a wrapper script to set up the python
environment.
Smoke tested by using the modified mklog.py to generate the ChangeLog
for this patch.
contrib/ChangeLog:
* mklog.py (main): New.
return FIRST_LINE_OF_END_RE.match(line) is None
-if __name__ == '__main__':
+def main():
extra_args = os.getenv('GCC_MKLOG_ARGS')
if extra_args:
sys.argv += json.loads(extra_args)
f.write('\n'.join(end))
else:
print(output, end='')
+
+if __name__ == '__main__':
+ main()