From patchwork Sun Jan 22 13:38:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 718177 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3v5wXZ6Xdzz9t1L for ; Mon, 23 Jan 2017 00:39:25 +1100 (AEDT) Received: from localhost ([::1]:36376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVIMa-0004dJ-B9 for incoming@patchwork.ozlabs.org; Sun, 22 Jan 2017 08:39:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVILw-0004KZ-Bf for qemu-devel@nongnu.org; Sun, 22 Jan 2017 08:38:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cVILt-0000Wm-8n for qemu-devel@nongnu.org; Sun, 22 Jan 2017 08:38:40 -0500 Received: from mail.weilnetz.de ([37.221.199.173]:37961) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVILt-0000WW-2J; Sun, 22 Jan 2017 08:38:37 -0500 Received: from localhost (v220110690675601.yourvserver.net.local [127.0.0.1]) by mail.weilnetz.de (Postfix) with ESMTP id 9C75A11810A8; Sun, 22 Jan 2017 14:38:34 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at weilnetz.de Received: from mail.weilnetz.de ([127.0.0.1]) by localhost (v220110690675601.yourvserver.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3hgxQehSiGpK; Sun, 22 Jan 2017 14:38:32 +0100 (CET) Received: from qemu.weilnetz.de (qemu.weilnetz.de [188.68.58.204]) by mail.weilnetz.de (Postfix) with ESMTP id 3A8B211810A5; Sun, 22 Jan 2017 14:38:32 +0100 (CET) Received: by qemu.weilnetz.de (Postfix, from userid 1000) id 111BD460C23; Sun, 22 Jan 2017 14:38:32 +0100 (CET) From: Stefan Weil To: QEMU Developer , QEMU Trivial Date: Sun, 22 Jan 2017 14:38:31 +0100 Message-Id: <20170122133831.26150-1-sw@weilnetz.de> X-Mailer: git-send-email 2.11.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 37.221.199.173 Subject: [Qemu-devel] [PATCH] qapi2texi: Suppress unwanted commas in generated output X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Stefan Weil , Markus Armbruster , Michael Roth Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 --- 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))