1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-19 00:17:51 +02:00

move parser_name to except block

This commit is contained in:
Kelly Brazil
2019-11-11 16:27:28 -08:00
parent 4083dd4260
commit 363fd3eab4

View File

@ -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)