diff options
author | Mathias Stearn <mathias@10gen.com> | 2017-08-28 17:05:07 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2017-08-29 19:05:08 -0400 |
commit | 7deeaa1d9245ef2fa321871003f3a1401e899543 (patch) | |
tree | b330cd7a00066de4e4b65d4d801984ecead894b5 /buildscripts/errorcodes.py | |
parent | 3eab8637adc3f17f10de0d9229445d6214e5f01e (diff) | |
download | mongo-7deeaa1d9245ef2fa321871003f3a1401e899543.tar.gz |
SERVER-30877 Add --list-files option to errorcodes.py
Diffstat (limited to 'buildscripts/errorcodes.py')
-rwxr-xr-x | buildscripts/errorcodes.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/buildscripts/errorcodes.py b/buildscripts/errorcodes.py index 3c80fc1f551..fdce00e09ac 100755 --- a/buildscripts/errorcodes.py +++ b/buildscripts/errorcodes.py @@ -27,6 +27,7 @@ codes = [] # Each AssertLocation identifies the C++ source location of an assertion AssertLocation = namedtuple( "AssertLocation", ['sourceFile', 'byteOffset', 'lines', 'code'] ) +list_files = False # Of historical interest only def assignErrorCodes(): @@ -65,6 +66,9 @@ def parseSourceFiles( callback ): bad = [ re.compile( r"^\s*assert *\(" ) ] for sourceFile in utils.getAllSourceFiles(prefix='src/mongo/'): + if list_files: + print 'scanning file: ' + sourceFile + with open(sourceFile) as f: text = f.read() @@ -252,8 +256,14 @@ def main(): parser.add_option("-q", "--quiet", dest="quiet", action="store_true", default=False, help="Suppress output on success [default: %default]") + parser.add_option("--list-files", dest="list_files", + action="store_true", default=False, + help="Print the name of each file as it is scanned [default: %default]") (options, args) = parser.parse_args() + global list_files + list_files = options.list_files + (codes, errors) = readErrorCodes() ok = len(errors) == 0 |