qapi2texi: Don't hide undocumented members and arguments

Show undocumented object, alternate type members and command, event
arguments exactly like undocumented enumeration type values.

Example change (qemu-qmp-ref.txt):

  -- Command: query-rocker

      Return rocker switch information.

+     Arguments:
+     'name'
+          Not documented
+
      Returns: 'Rocker' information

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <1489582656-31133-24-git-send-email-armbru@redhat.com>
This commit is contained in:
Markus Armbruster 2017-03-15 13:57:12 +01:00
parent 5da19f14ff
commit 2c99f5fdc8
1 changed files with 4 additions and 8 deletions

View File

@ -139,12 +139,10 @@ def texi_member(member):
member.name, ' (optional)' if member.optional else '') member.name, ' (optional)' if member.optional else '')
def texi_members(doc, what, member_func, show_undocumented): def texi_members(doc, what, member_func):
"""Format the table of members""" """Format the table of members"""
items = '' items = ''
for section in doc.args.itervalues(): for section in doc.args.itervalues():
if not section.content and not show_undocumented:
continue # Undocumented TODO require doc and drop
if section.content: if section.content:
desc = str(section) desc = str(section)
else: else:
@ -172,10 +170,9 @@ def texi_sections(doc):
return body return body
def texi_entity(doc, what, member_func=texi_member, def texi_entity(doc, what, member_func=texi_member):
show_undocumented=False):
return (texi_body(doc) return (texi_body(doc)
+ texi_members(doc, what, member_func, show_undocumented) + texi_members(doc, what, member_func)
+ texi_sections(doc)) + texi_sections(doc))
@ -194,8 +191,7 @@ class QAPISchemaGenDocVisitor(qapi.QAPISchemaVisitor):
self.out += TYPE_FMT(type='Enum', self.out += TYPE_FMT(type='Enum',
name=doc.symbol, name=doc.symbol,
body=texi_entity(doc, 'Values', body=texi_entity(doc, 'Values',
member_func=texi_enum_value, member_func=texi_enum_value))
show_undocumented=True))
def visit_object_type(self, name, info, base, members, variants): def visit_object_type(self, name, info, base, members, variants):
doc = self.cur_doc doc = self.cur_doc