Improve argparse behavior for its role in making the API work

This commit is contained in:
James R. Barlow
2019-05-22 15:55:48 -07:00
parent 8bcb85720c
commit db69b4d11a
2 changed files with 20 additions and 5 deletions
+2 -4
View File
@@ -128,10 +128,8 @@ def create_options(*, input_file, output_file, **kwargs):
cmdline.append(str(input_file))
cmdline.append(str(output_file))
try:
options = parser.parse_args(cmdline)
except argparse.ArgumentError as e:
raise ValueError(str(e))
parser.api_mode = True
options = parser.parse_args(cmdline)
return options