add optional params to doc strings

This commit is contained in:
John Cupitt 2020-08-17 14:11:17 +01:00
parent 0d9dce4326
commit c7bab32109
2 changed files with 1509 additions and 2 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/python3
# This file generates the member definitions and declarations for all vips
# operators.
@ -95,6 +95,15 @@ def generate_operation(operation_name, declaration_only=False):
if declaration_only:
result = '\n/**\n * {}.'.format(intro.description.capitalize())
if len(intro.optional_input) > 0:
result += '\n *\n * **Optional parameters**'
for name in intro.optional_input:
details = intro.details[name]
result += f'\n * - {cppize(name)} -- '
result += f'{details["blurb"]}, '
result += f'{get_cpp_type(details["type"])}.'
result += '\n *'
for name in intro.method_args:
result += '\n * @param {} {}.' \
.format(cppize(name), intro.details[name]['blurb'])

File diff suppressed because it is too large Load Diff