mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-19 00:17:51 +02:00
use real parser name in error message
This commit is contained in:
@ -106,7 +106,7 @@ def about_jc():
|
|||||||
}
|
}
|
||||||
parser_list.append(parser_entry)
|
parser_list.append(parser_entry)
|
||||||
|
|
||||||
result = {
|
return {
|
||||||
'name': __name__,
|
'name': __name__,
|
||||||
'version': info.version,
|
'version': info.version,
|
||||||
'description': info.description,
|
'description': info.description,
|
||||||
@ -115,8 +115,6 @@ def about_jc():
|
|||||||
'parsers': parser_list
|
'parsers': parser_list
|
||||||
}
|
}
|
||||||
|
|
||||||
return result
|
|
||||||
|
|
||||||
|
|
||||||
def helptext(message):
|
def helptext(message):
|
||||||
parsers_string = parsers_text()
|
parsers_string = parsers_text()
|
||||||
@ -197,7 +195,7 @@ def main():
|
|||||||
found = True
|
found = True
|
||||||
break
|
break
|
||||||
except:
|
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.')
|
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)
|
exit(1)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user