From bf5f80476cff642ae672187ea59d40bdb602101e Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Sat, 14 Dec 2019 23:56:22 -0800 Subject: [PATCH] use real parser name in error message --- jc/cli.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/jc/cli.py b/jc/cli.py index 2a015b77..836b67a8 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -106,7 +106,7 @@ def about_jc(): } parser_list.append(parser_entry) - result = { + return { 'name': __name__, 'version': info.version, 'description': info.description, @@ -115,8 +115,6 @@ def about_jc(): 'parsers': parser_list } - return result - def helptext(message): parsers_string = parsers_text() @@ -197,7 +195,7 @@ def main(): found = True break except: - parser_name = arg.lstrip('--') + parser_name = parser_map[arg].__name__.split('.')[-1] jc.utils.error_message(f'{parser_name} parser could not parse the input data. Did you use the correct parser?\n For details use the -d option.') exit(1)