From patchwork Tue Jan 8 12:33:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 10751971 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 236DC91E for ; Tue, 8 Jan 2019 12:34:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B1BB28BF1 for ; Tue, 8 Jan 2019 12:34:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F40B528C37; Tue, 8 Jan 2019 12:34:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 46F7628BF1 for ; Tue, 8 Jan 2019 12:34:16 +0000 (UTC) Received: from localhost ([127.0.0.1]:54774 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggqaF-0001RU-V0 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 08 Jan 2019 07:34:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54020) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggqZY-00016U-9H for qemu-devel@nongnu.org; Tue, 08 Jan 2019 07:33:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggqZX-0008Fa-KW for qemu-devel@nongnu.org; Tue, 08 Jan 2019 07:33:32 -0500 Received: from smtp03.citrix.com ([162.221.156.55]:24542) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ggqZX-00084x-Cq for qemu-devel@nongnu.org; Tue, 08 Jan 2019 07:33:31 -0500 X-IronPort-AV: E=Sophos;i="5.56,454,1539648000"; d="scan'208";a="75047833" From: Anthony PERARD To: Date: Tue, 8 Jan 2019 12:33:11 +0000 Message-ID: <20190108123311.24456-1-anthony.perard@citrix.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 162.221.156.55 Subject: [Qemu-devel] [PATCH] qmp-shell: Fix example with objects as values 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: Anthony PERARD , Markus Armbruster , Eduardo Habkost , Cleber Rosa Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The example shown that is suppose to let a user passes an object/array as argument doesn't work. The quotes get removed by shlex.split() and then both JSON parser complains. Fix the example by adding quotes and add examples with boolean and array. Signed-off-by: Anthony PERARD --- scripts/qmp/qmp-shell | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell index 770140772d..9937e3c888 100755 --- a/scripts/qmp/qmp-shell +++ b/scripts/qmp/qmp-shell @@ -33,7 +33,11 @@ # key=value pairs also support Python or JSON object literal subset notations, # without spaces. Dictionaries/objects {} are supported as are arrays []. # -# example-command arg-name1={'key':'value','obj'={'prop':"value"}} +# JSON: +# example-command arg-name1='{"key":"value","obj":{"prop":"value"}}' +# example-command arg-name1='{"key":"value","obj":[1,true,"three"]}' +# free style: +# example-command arg-name1="{'key':'value',\"obj\":[1,True,\"three\"]}" # # Both JSON and Python formatting should work, including both styles of # string literal quotes. Both paradigms of literal values should work,