diff --git a/src/scripts/pycompare.py b/src/scripts/pycompare.py index 01ea0144260265d0e3f6ac79d430b2dd00520229..b4b0a0c39702116396203f7d401778ce134e28d1 100755 --- a/src/scripts/pycompare.py +++ b/src/scripts/pycompare.py @@ -51,7 +51,13 @@ number_reg = re.compile(r'-?[0-9]\.[0-9]+E?[-+][0-9]{2,5}') # # \returns errors: `int` Number of detected error-level inconsistencies. def main(): - config = parse_arguments() + config = {} + try: + config = parse_arguments() + except ValueError as ex: + print(ex) + print("\nType \"pycompare.py --help\" to get more detailed help.") + exit(1) errors, warnings, noisy = (0, 0, 0) if config['help_mode'] or len(argv) == 1: config['help_mode'] = True @@ -527,7 +533,7 @@ def parse_arguments(): elif (arg.startswith("--warn")): config['warning_threshold'] = float(split_arg[1]) else: - raise Exception("Unrecognized argument \'{0:s}\'".format(arg)) + raise ValueError("Unrecognized argument \'{0:s}\'".format(arg)) arg_index += 1 return config