https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9f6a1c916492db2f5a4a8f...
commit 9f6a1c916492db2f5a4a8fabe00edde84f2a2aa9 Author: Mark Jansen mark.jansen@reactos.org AuthorDate: Fri Dec 27 19:51:20 2019 +0100 Commit: Mark Jansen mark.jansen@reactos.org CommitDate: Fri Dec 27 19:51:20 2019 +0100
[SDK] Add usage / help to gen_baseaddress.py --- sdk/tools/gen_baseaddress.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/sdk/tools/gen_baseaddress.py b/sdk/tools/gen_baseaddress.py index f214012a982..e709dfb9822 100644 --- a/sdk/tools/gen_baseaddress.py +++ b/sdk/tools/gen_baseaddress.py @@ -4,7 +4,19 @@ LICENSE: MIT (https://spdx.org/licenses/MIT) PURPOSE: Update baseaddresses of all modules COPYRIGHT: Copyright 2017,2018 Mark Jansen (mark.jansen@reactos.org) ''' + from __future__ import print_function, absolute_import, division + +USAGE = """ +This script will update the baseaddresses of all modules, based on the build output. + +Specify the build output dir as commandline argument to the script: +`python gen_baseaddress.py C:\Users\Mark\reactos\output-MinGW-i386` + +Multiple directories can be specified: +`python gen_baseaddress r:/build/msvc r:/build/gcc` +""" + import os import struct import sys @@ -15,6 +27,7 @@ except ImportError: print('# Please install pefile from pip or https://github.com/erocarrera/pefile') sys.exit(-1)
+ ALL_EXTENSIONS = ( '.dll', '.acm', '.ax', '.cpl', '.drv', '.ocx' ) @@ -365,10 +378,14 @@ def main(): dirs = sys.argv[1:] if len(dirs) < 1: trydir = os.getcwd() - print('# No path specified, trying', trydir) + print(USAGE) + print('No path specified, trying the working directory: ', trydir) dirs = [trydir] for onedir in dirs: - run_dir(onedir) + if onedir.lower() in ['-help', '/help', '/h', '-h', '/?', '-?']: + print(USAGE) + else: + run_dir(onedir)
if __name__ == '__main__':