qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qmp-shell: Fix example with objects as values
@ 2019-01-08 12:33 Anthony PERARD
  2019-01-11 14:37 ` Cleber Rosa
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony PERARD @ 2019-01-08 12:33 UTC (permalink / raw)
  To: qemu-devel
  Cc: Anthony PERARD, Eduardo Habkost, Cleber Rosa, Markus Armbruster

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-14 17:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-08 12:33 [Qemu-devel] [PATCH] qmp-shell: Fix example with objects as values Anthony PERARD
2019-01-11 14:37 ` Cleber Rosa
2019-01-14 17:43   ` Eduardo Habkost

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).