diff --git a/DFGdocs.py b/DFGdocs.py index 131622f..3f3752e 100755 --- a/DFGdocs.py +++ b/DFGdocs.py @@ -138,8 +138,13 @@ def args_check(args, parser, templates): sys.exit(2) if args.info and args.template is not None: - templates[args.template].full_info() - sys.exit(0) + if args.template in templates: + templates[args.template].full_info() + sys.exit(0) + else: + print(f"Error using DFGdocs. Template {args.template} is not defined!") + print_templates(templates) + sys.exit(2) if args.name is None: print(f"Error using DFGdocs. NAME argument is not defined!") @@ -149,7 +154,7 @@ def args_check(args, parser, templates): if args.template not in templates: print(f"Error using DFGdocs. Template {args.template} is not defined!") print_templates(templates) - sys.exit(0) + sys.exit(2) def main():