[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PATCH] qapi2texi: Suppress unwanted commas in generated
From: |
Stefan Weil |
Subject: |
[Qemu-trivial] [PATCH] qapi2texi: Suppress unwanted commas in generated output |
Date: |
Sun, 22 Jan 2017 14:38:31 +0100 |
Parts of the code use #optional followed by a comma.
We don't want that comma to be part of the generated documentation,
so remove it, too.
Signed-off-by: Stefan Weil <address@hidden>
---
I added the generated documentation to https://qemu.weilnetz.de/doc/.
See https://qemu.weilnetz.de/doc/qemu-qmp-ref.html for an
example of the output without this patch (look for ", net").
We could also remove the commas from the code, but I think
that removing them programmatically is more robust (and also
allows people placing commas as they like).
Regards
Stefan
scripts/qapi2texi.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py
index 83ded95c2d..65c4aecfaf 100755
--- a/scripts/qapi2texi.py
+++ b/scripts/qapi2texi.py
@@ -146,7 +146,7 @@ def texi_body(doc):
desc = str(section)
opt = ''
if "#optional" in desc:
- desc = desc.replace("#optional", "")
+ desc = re.sub("#optional,?", "", desc)
opt = ' (optional)'
body += "@item @code{'%s'}%s\n%s\n" % (arg, opt,
texi_format(desc))
--
2.11.0
- [Qemu-trivial] [PATCH] qapi2texi: Suppress unwanted commas in generated output,
Stefan Weil <=