From f1dd988beaa94ff75c3648568e21e4ea7ff64692 Mon Sep 17 00:00:00 2001 From: Jan Grewe Date: Sun, 22 Oct 2023 14:04:44 +0200 Subject: [PATCH] fixes --- DFGdocs.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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():