Add index and rindex builtins

This commit is contained in:
Nicolas Williams committed 2013-12-04 18:21:42 -06:00
1 parent cac14a531d
commit b37ce20c2a
1 file changed
+2
+2
View File
@@ -676,6 +676,8 @@ static const char* const jq_builtins[] = {
"def from_entries: map({(.key): .value}) | add;",
"def with_entries(f): to_entries | map(f) | from_entries;",
"def reverse: [.[length - 1 - range(0;length)]];",
"def index(i): .[i][0];",
"def rindex(i): .[i][-1:][0];",
};