diff options
-rwxr-xr-x | kpov_judge/test_task.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/kpov_judge/test_task.py b/kpov_judge/test_task.py index a1f3608..ad8c963 100755 --- a/kpov_judge/test_task.py +++ b/kpov_judge/test_task.py @@ -114,15 +114,15 @@ def load_params(filename): if __name__ == '__main__': # get the parameters needed to get to the task, such as the URLs, the name of the task and optionally an ID from the student # start with the the parameters needed for the dialog gui to work - argparser = argparse.ArgumentParser(conflict_handler='resolve', add_help=False, - description='Get task parameters') + argparser = argparse.ArgumentParser(conflict_handler='resolve', + description='Test a KPOV Judge task.') argparser.add_argument('-h', '--help', action='store_true') argparser.add_argument('-q', '--quiet', action='store_true', help='disable prompts') argparser.add_argument('-g', '--generate_params', action='store_true', help='generate initial values for the task parameters') argparser.add_argument('-pf', '--params_file', nargs='?', default=PARAMS_FILE, - help='a local file containing saved param values') + help='a local file with saved param values') basic_args, unknown_args = argparser.parse_known_args() # get default parameters including language @@ -133,6 +133,10 @@ if __name__ == '__main__': basic_args, unknown_args = argparser.parse_known_args() params['language'] = basic_args.language + if basic_args.help: + argparser.print_help() + exit(0) + # continue with the parameters needed to get the task params = locate_task(params, argparser, quiet=basic_args.quiet) # TODO: if the task name is missing or invalid, try to get a list of tasks @@ -205,9 +209,6 @@ if __name__ == '__main__': task_params[k] = args[k] if not basic_args.quiet: task_params = get_params(task_params, task_params_meta, language=params['language']) - if basic_args.help: - print(task_argparser.format_help()) - exit(0) public_params = {} for k in inspect.getargs(task.__code__)[0]: |