summaryrefslogtreecommitdiff
path: root/scripts/check_repeated_token.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/check_repeated_token.py')
-rwxr-xr-xscripts/check_repeated_token.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/scripts/check_repeated_token.py b/scripts/check_repeated_token.py
index 16362813..2c2d8240 100755
--- a/scripts/check_repeated_token.py
+++ b/scripts/check_repeated_token.py
@@ -55,16 +55,7 @@ def check_file(path, threshold, single_only):
return True
-def main(args):
- def check_file_callback(path):
- return check_file(path, args.threshold, args.single)
-
- if process_output_files(args.TEST_ROOT, check_file_callback) > 0:
- return 1
- return 0
-
-
-if __name__ == '__main__':
+def main():
parser = argparse.ArgumentParser()
parser.add_argument('TEST_ROOT',
help='Root directory containing the tests')
@@ -74,4 +65,14 @@ if __name__ == '__main__':
parser.add_argument('-s', '--single', action='store_true', default=False,
help='Only look at tokens matching a single character')
args = parser.parse_args()
- sys.exit(main(args))
+
+ def check_file_callback(path):
+ return check_file(path, args.threshold, args.single)
+
+ if process_output_files(args.TEST_ROOT, check_file_callback) > 0:
+ return 1
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main())