1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

Add break builtin for foreach

This commit is contained in:
Nicolas Williams
2014-07-07 18:48:13 -05:00
parent 6458910ba3
commit 539dccae90
4 changed files with 7 additions and 4 deletions

View File

@@ -1844,8 +1844,7 @@ sections:
This is mostly useful only for constructing `reduce`- and
`limit`-like functions. But it is much more general, as it
allows for partial reductions (see the example below), as well
as breaking out of the "loop" with `empty`, or even `error(x)`
if there's a try/catch around the foreach.
as breaking out of the "loop" with `break`.
examples:
- program: '[foreach .[] as $item