summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-03-27 15:01:54 +0000
committerMichael Williamson <mike@zwobble.org>2014-03-27 15:01:54 +0000
commitab0c4b49e2f6d73df4ebfceb2037f1cd29edb3d6 (patch)
tree0cb6138bdbc263b390b03a9e08df59f6f3c24760
parent5c28a95722cb748521199afe3200b66fa6a72b68 (diff)
Clarify multiple_output usage
-rw-r--r--README.md9
1 files 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]
```