Fix CLI parser to accept negative integers as valid (#927)

Fixes #11381
This commit is contained in:
Paul Culley 2019-10-16 16:47:55 -05:00 committed by Sam Manzi
parent c312c96987
commit f7bd062bdb

View File

@ -88,9 +88,9 @@ def _convert_str_to_match_type(str_val, type_val):
return str(str_val)
elif ret_type == int:
if str_val.isdigit():
try:
return int(str_val)
else:
except ValueError:
print("'%s' is not an integer number" % str_val)
return 0