From ab0c4b49e2f6d73df4ebfceb2037f1cd29edb3d6 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 27 Mar 2014 15:01:54 +0000 Subject: Clarify multiple_output usage --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b3e347e..5802171 100644 --- a/README.md +++ b/README.md @@ -32,14 +32,15 @@ irrespective of the value of `multiple_output`: jq(".[]").transform("[1, 2, 3]", text_output=True) == "1\n2\n3" ``` -The `multiple_output` argument can be used for cases when multiple output elements are expected: +If `multiple_output` is `False` (the default), then the first output is used: ```python -jq(".[]+1").transform([1, 2, 3], multiple_output=True) == [2, 3, 4] +jq(".[]+1").transform([1, 2, 3]) == 2 ``` -If there are multiple output elements, but `multiple_output` is not set to `True`, then the first output is used: +If `multiple_output` is `True`, +all output elements are returned in an array: ```python -jq(".[]+1").transform([1, 2, 3]) == 2 +jq(".[]+1").transform([1, 2, 3], multiple_output=True) == [2, 3, 4] ``` -- cgit v1.2.3