qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: qemu-devel@nongnu.org
Cc: Anthony PERARD <anthony.perard@citrix.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Cleber Rosa <crosa@redhat.com>,
	Markus Armbruster <armbru@redhat.com>
Subject: [Qemu-devel] [PATCH] qmp-shell: Fix example with objects as values
Date: Tue, 8 Jan 2019 12:33:11 +0000	[thread overview]
Message-ID: <20190108123311.24456-1-anthony.perard@citrix.com> (raw)

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 <anthony.perard@citrix.com>
---
 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,
-- 
Anthony PERARD

             reply	other threads:[~2019-01-08 12:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-08 12:33 Anthony PERARD [this message]
2019-01-11 14:37 ` [Qemu-devel] [PATCH] qmp-shell: Fix example with objects as values Cleber Rosa
2019-01-14 17:43   ` Eduardo Habkost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190108123311.24456-1-anthony.perard@citrix.com \
    --to=anthony.perard@citrix.com \
    --cc=armbru@redhat.com \
    --cc=crosa@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).