aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi2texi.py
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2017-03-15 13:57:14 +0100
committerMarkus Armbruster <armbru@redhat.com>2017-03-16 07:13:03 +0100
commit691e03133e79fd1f70ea4b524cdd10cbc23fd72a (patch)
treeeeb20596e51ec9d2b56f0c2543218ae6eb4a21e3 /scripts/qapi2texi.py
parentc2dd311cb72b0ef59287aad3c0c7ee968c7289e2 (diff)
qapi2texi: Include member type in generated documentation
The recent merge of docs/qmp-commands.txt and docs/qmp-events.txt into the schema lost type information. Fix this documentation regression. Example change (qemu-qmp-ref.txt): -- Struct: InputKeyEvent Keyboard input event. Members: - 'button' + 'button: InputButton' Which button this event is for. - 'down' + 'down: boolean' True for key-down and false for key-up events. Since: 2.0 Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-26-git-send-email-armbru@redhat.com>
Diffstat (limited to 'scripts/qapi2texi.py')
-rwxr-xr-xscripts/qapi2texi.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py
index 3dd0146ba0..993b65264f 100755
--- a/scripts/qapi2texi.py
+++ b/scripts/qapi2texi.py
@@ -135,8 +135,12 @@ def texi_enum_value(value):
def texi_member(member):
"""Format a table of members item for an object type member"""
- return '@item @code{%s}%s\n' % (
- member.name, ' (optional)' if member.optional else '')
+ typ = member.type.doc_type()
+ return '@item @code{%s%s%s}%s\n' % (
+ member.name,
+ ': ' if typ else '',
+ typ if typ else '',
+ ' (optional)' if member.optional else '')
def texi_members(doc, what, member_func):