summaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
authorStephen Dolan <mu@netsoc.tcd.ie>2012-12-29 22:59:07 +0000
committerStephen Dolan <mu@netsoc.tcd.ie>2012-12-29 22:59:07 +0000
commitb3bad59dd7d9fcea575ef2de2843b9515b0630b4 (patch)
tree428463436b5e4a194b3c7ef1a251f6dc928836e0 /builtin.c
parente0cda536f331b0fc53b493069dce70bb32de9a8b (diff)
Add the `recurse` function. See #37.
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin.c b/builtin.c
index b0c6c34c..5818a6a4 100644
--- a/builtin.c
+++ b/builtin.c
@@ -544,7 +544,7 @@ static const char* jq_builtins[] = {
"def del(f): delpaths([path(f)]);",
"def _assign(paths; value): value as $v | fold . as $obj (path(paths) as $p | $obj | setpath($p; $v));",
"def _modify(paths; update): fold . as $obj (path(paths) as $p | $obj | setpath($p; getpath($p) | update));",
-
+ "def recurse(f): ., (f | select(. != null) | recurse(f));",
};