diff options
Diffstat (limited to 'tools/docs/kernel-doc')
| -rwxr-xr-x | tools/docs/kernel-doc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/docs/kernel-doc b/tools/docs/kernel-doc index d9192c3f1645..4c45c0d6cfa9 100755 --- a/tools/docs/kernel-doc +++ b/tools/docs/kernel-doc @@ -250,6 +250,8 @@ def main(): help="Output reStructuredText format (default).") out_fmt.add_argument("-N", "-none", "--none", action="store_true", help="Do not output documentation, only warnings.") + out_fmt.add_argument("-apispec", "--apispec", action="store_true", + help="Output C macro invocations for kernel API specifications.") out_fmt.add_argument("-y", "--yaml-file", "--yaml", help="Stores kernel-doc output on a yaml file.") @@ -326,6 +328,7 @@ def main(): # from kdoc.kdoc_files import KernelFiles # pylint: disable=C0415 from kdoc.kdoc_output import RestFormat, ManFormat # pylint: disable=C0415 + from kdoc.kdoc_apispec import ApiSpecFormat # pylint: disable=C0415 yaml_content = set() if args.yaml_file: @@ -351,12 +354,16 @@ def main(): out_style = None n_outputs += 1 + if args.apispec: + out_style = ApiSpecFormat() + n_outputs += 1 + if args.rst or n_outputs == 0: n_outputs += 1 out_style = RestFormat() if n_outputs > 1: - parser.error("Those arguments are muttually exclusive: --man, --rst, --none, except when generating a YAML file.") + parser.error("Those arguments are muttually exclusive: --man, --rst, --none, --apispec, except when generating a YAML file.") elif not n_outputs: out_style = RestFormat() @@ -365,7 +372,8 @@ def main(): yaml_file=args.yaml_file, yaml_content=yaml_content, out_style=out_style, werror=args.werror, wreturn=args.wreturn, wshort_desc=args.wshort_desc, - wcontents_before_sections=args.wcontents_before_sections) + wcontents_before_sections=args.wcontents_before_sections, + apispec=args.apispec) kfiles.parse(args.files, export_file=args.export_file) |
