Skip to content

Commit b0055f6

Browse files
apaszkesoumith
authored andcommitted
Improve argument checks for long arg options
1 parent 90040af commit b0055f6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tools/cwrap/plugins/THPPlugin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,12 @@ def process_all_checks(self, code, option):
424424
code = checks + code
425425
else:
426426
code = "__out == NULL &&\n" + indent + code
427+
427428
if any(arg.get('long_args', False) for arg in option['arguments']):
428429
code = code.replace('__argcount ==', '__argcount >=')
430+
expected = str(int(option.get('output_provided', False)))
431+
code = '__dictcount == ' + expected + ' &&\n ' + code
432+
429433
return code
430434

431435
def process_option_code_template(self, template, option):

0 commit comments

Comments
 (0)