From 363fd3eab409351121dab8a11c6b565829ccd84a Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 11 Nov 2019 16:27:28 -0800 Subject: [PATCH] move parser_name to except block --- jc/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jc/cli.py b/jc/cli.py index c8f8c33a..7514dcb9 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -136,11 +136,11 @@ def main(): for arg in sys.argv: if arg in parser_map: try: - parser_name = arg.lstrip('--') result = parser_map[arg](data, raw=raw, quiet=quiet) found = True break except: + parser_name = arg.lstrip('--') 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)