]> granicus.if.org Git - jq/log
jq
10 years agoAdd `?`, `.[]?`, and `..` operators 298/head
Nicolas Williams [Mon, 17 Feb 2014 18:28:26 +0000 (12:28 -0600)]
Add `?`, `.[]?`, and `..` operators

Make XPath-like `//a/b` recursive structure traversal easier in jq,
which then becomes:

    ..|.a?.b?

The `?` operator suppresses errors about . not being an array or object.
The `..` operator is equivalent to calling the new `recurse_down`
built-in, which in turn is equivalent to

    recurse(.[]?)

Note that `..a` is not supported; neither is `...a`.  That could be add
added, but it doesn't seem worth the trouble of saving the need to type
a '|'.

10 years agoMerge pull request #300 from lcd047/master
Nico Williams [Wed, 19 Feb 2014 17:21:04 +0000 (11:21 -0600)]
Merge pull request #300 from lcd047/master

Fix building of the manual

10 years agomanual.yml: fix indent for the new `any` and `all` commands. 300/head
LCD 47 [Wed, 19 Feb 2014 13:10:32 +0000 (15:10 +0200)]
manual.yml: fix indent for the new `any` and `all` commands.

10 years agoMerge pull request #296 from slapresta/all-any
Nico Williams [Mon, 17 Feb 2014 04:45:49 +0000 (22:45 -0600)]
Merge pull request #296 from slapresta/all-any

Added `all` and `any` builtins

10 years agoAdded `all` and `any` builtins 296/head
Santiago Lapresta [Mon, 17 Feb 2014 03:01:32 +0000 (04:01 +0100)]
Added `all` and `any` builtins

10 years agoFix cut-n-paste in `leaf_paths`; doc and test 'em
Nicolas Williams [Thu, 6 Feb 2014 05:14:05 +0000 (23:14 -0600)]
Fix cut-n-paste in `leaf_paths`; doc and test 'em

10 years ago#285 add and builtins
Nicolas Williams [Wed, 5 Feb 2014 21:23:32 +0000 (15:23 -0600)]
#285 add  and  builtins

10 years agoFix #201; check that bison accepts --warnings
Nicolas Williams [Thu, 2 Jan 2014 05:10:00 +0000 (23:10 -0600)]
Fix #201; check that bison accepts --warnings

10 years agoFix version for make dist on master
Nicolas Williams [Tue, 31 Dec 2013 23:15:44 +0000 (17:15 -0600)]
Fix version for make dist on master

 - Re-remove VERSION file and all traces of it
 - Pass a decent version indicator to AC_INIT (using git describe)

When we tag 1.4 this will produce 1.4 as the version string when
building on the HEAD of that tag.

11 years agoFix rpm build (`make rpm`)
Joe Littlejohn [Mon, 19 Aug 2013 12:55:52 +0000 (13:55 +0100)]
Fix rpm build (`make rpm`)

* Re-add VERSION as it's required for `./setup superclean`
  and `make rpm`.
* Add *.rpm to git ignore, we never want them under version control.

11 years agoinclude additional files in jq.spec
Filippo Giunchedi [Wed, 16 Oct 2013 16:25:41 +0000 (12:25 -0400)]
include additional files in jq.spec

this will probably need changing upon SONAME bump

11 years agofix rpm Makefile target and prerequisites
Filippo Giunchedi [Wed, 16 Oct 2013 16:24:27 +0000 (12:24 -0400)]
fix rpm Makefile target and prerequisites

depend on dist and the specfile, plus use automake's variables

11 years agoDocument --version
Nicolas Williams [Fri, 27 Dec 2013 00:48:51 +0000 (18:48 -0600)]
Document --version

11 years agoAdd jv_dumpf() and jv_show()
Nicolas Williams [Fri, 27 Dec 2013 00:37:17 +0000 (18:37 -0600)]
Add jv_dumpf() and jv_show()

jv_dumpf() takes a FILE *.

jv_show() is intended for use in debuggers, so it dumps the jv to stderr
and it does not jv_free() the jv, so it's safe to
"call jv_show(some_jv, -1)" in a debugger.  If flags == -1 then the jv
will be shown pretty-printed and in color.

11 years agoDocument .foo.bar in manual
Nicolas Williams [Fri, 27 Dec 2013 00:25:31 +0000 (18:25 -0600)]
Document .foo.bar in manual

11 years agoDocument exit numbers
Nicolas Williams [Thu, 26 Dec 2013 18:54:07 +0000 (12:54 -0600)]
Document exit numbers

11 years agoNormalize errors for -e
Nicolas Williams [Thu, 26 Dec 2013 18:54:03 +0000 (12:54 -0600)]
Normalize errors for -e

11 years agoFix doc typos (.[foo] wanted to be .["foo"])
Nicolas Williams [Wed, 25 Dec 2013 23:09:27 +0000 (17:09 -0600)]
Fix doc typos (.[foo] wanted to be .["foo"])

11 years agoAdd note to jq.1 about shell quoting
Nicolas Williams [Wed, 25 Dec 2013 23:05:32 +0000 (17:05 -0600)]
Add note to jq.1 about shell quoting

11 years agoMerge pull request #251 from phihag/fix-uri-in-manual
Stephen Dolan [Sat, 21 Dec 2013 19:47:24 +0000 (11:47 -0800)]
Merge pull request #251 from phihag/fix-uri-in-manual

Fix @uri example

11 years agoMerge pull request #252 from phihag/ignore-config-test-driver
Stephen Dolan [Sat, 21 Dec 2013 19:46:53 +0000 (11:46 -0800)]
Merge pull request #252 from phihag/ignore-config-test-driver

Ignore the config/test-driver file

11 years agoIgnore the config/test-driver file 252/head
Philipp Hagemeister [Fri, 20 Dec 2013 10:36:52 +0000 (11:36 +0100)]
Ignore the config/test-driver file

This file is automatically generated and does not need to be committed.

11 years agoFix @uri example 251/head
Philipp Hagemeister [Fri, 20 Dec 2013 10:32:26 +0000 (11:32 +0100)]
Fix @uri example

Previously, the @uri example didn't match the actual behavior of the current jq, as exclamation marks do not need to be encoded in URIs.
Replace the example with an input that needs encoding, and is encoded by jq.

11 years agoAllow negated object values without parens. Fixes #247
Stephen Dolan [Tue, 17 Dec 2013 22:28:26 +0000 (22:28 +0000)]
Allow negated object values without parens. Fixes #247

11 years agoFix memmem() error
Nicolas Williams [Tue, 17 Dec 2013 14:40:03 +0000 (08:40 -0600)]
Fix memmem() error

11 years agoMerge pull request #242 from sieben/travis-ci
Stephen Dolan [Sun, 15 Dec 2013 20:54:17 +0000 (12:54 -0800)]
Merge pull request #242 from sieben/travis-ci

Adding a .travis.yml file to use the travis-ci.org

11 years agoAdding a .travis.yml file to use the travis-ci.org 242/head
Rémy Léone [Thu, 12 Dec 2013 15:23:07 +0000 (16:23 +0100)]
Adding a .travis.yml file to use the travis-ci.org

From wikipedia:

Travis CI is a hosted, distributed continuous integration service used
to build and test projects hosted at GitHub.

Travis CI is configured by adding a file named .travis.yml, which is a
YAML format text file, to the root directory of the GitHub repository.

Travis CI automatically detects when a commit has been made and pushed
to a GitHub repository that is using Travis CI, and each time this
happens, it will try to build the project and run tests. This includes
commits to all branches, not just to the master branch. When that
process has completed, it will notify a developer in the way it has been
configured to do so — for example, by sending an email containing the
test results (showing success or failure), or by posting a message on an
IRC channel. It can be configured to run the tests on a range of
different machines, with different software installed (such as older
versions of a programming language, to test for compatibility).

11 years agoMake the testsuite run on machines without valgrind
Stephen Dolan [Fri, 13 Dec 2013 01:07:26 +0000 (01:07 +0000)]
Make the testsuite run on machines without valgrind

11 years agoFormat more integers as integers, not scientific notation.
Stephen Dolan [Mon, 9 Dec 2013 12:05:53 +0000 (12:05 +0000)]
Format more integers as integers, not scientific notation.

jq is now willing to put up to 15 zeros after an integer before
moving to scientific notation.

11 years agoMerge pull request #239 from DRMacIver/overflows
Stephen Dolan [Fri, 13 Dec 2013 00:38:14 +0000 (16:38 -0800)]
Merge pull request #239 from DRMacIver/overflows

Avoid undefined behaviour with large array indices

11 years agoComplete more-arity feature not complete
Nicolas Williams [Wed, 11 Dec 2013 20:13:57 +0000 (14:13 -0600)]
Complete more-arity feature not complete

And test

11 years agoMerge pull request #235 from DRMacIver/prototypes
Stephen Dolan [Tue, 10 Dec 2013 11:56:02 +0000 (03:56 -0800)]
Merge pull request #235 from DRMacIver/prototypes

some functions were missing proper prototypes

11 years agoconvert range bounds to integers in a way that avoids undefined behaviour 239/head
David R. MacIver [Tue, 10 Dec 2013 09:18:16 +0000 (09:18 +0000)]
convert range bounds to integers in a way that avoids undefined behaviour

11 years agoadd checking of numeric indices to an array to see if they can reasonably be consider...
David R. MacIver [Tue, 10 Dec 2013 09:17:30 +0000 (09:17 +0000)]
add checking of numeric indices to an array to see if they can reasonably be considered integers. Avoid undefined behaviour if out of bounds

11 years agosome functions were missing prototypes. Add them 235/head
David R. MacIver [Tue, 10 Dec 2013 00:07:08 +0000 (00:07 +0000)]
some functions were missing prototypes. Add them

11 years agoMerge pull request #232 from DRMacIver/teardown_on_error
Stephen Dolan [Mon, 9 Dec 2013 00:41:16 +0000 (16:41 -0800)]
Merge pull request #232 from DRMacIver/teardown_on_error

consistent use of goto out in main

11 years agodon't need to check for NULL there 232/head
David R. MacIver [Sun, 8 Dec 2013 23:52:07 +0000 (23:52 +0000)]
don't need to check for NULL there

11 years agoMerge pull request #233 from DRMacIver/printf
Stephen Dolan [Sun, 8 Dec 2013 23:44:33 +0000 (15:44 -0800)]
Merge pull request #233 from DRMacIver/printf

Fix warnings about vprintf

11 years agoMerge pull request #231 from DRMacIver/fix_mem_leak_in_compile
Stephen Dolan [Sun, 8 Dec 2013 23:17:20 +0000 (15:17 -0800)]
Merge pull request #231 from DRMacIver/fix_mem_leak_in_compile

args to jq_compile_args were not getting freed when there were errors in the compile

11 years agoClean up string/object interactions in jv.
Stephen Dolan [Sun, 8 Dec 2013 22:23:43 +0000 (22:23 +0000)]
Clean up string/object interactions in jv.

11 years agoThese vfprintfs are being used as if they were printfs. Fix that 233/head
David R. MacIver [Sun, 8 Dec 2013 20:08:04 +0000 (20:08 +0000)]
These vfprintfs are being used as if they were printfs. Fix that

11 years agoconsistent use of goto out in main
David R. MacIver [Sun, 8 Dec 2013 19:22:18 +0000 (19:22 +0000)]
consistent use of goto out in main

11 years agoRefactor jv structure.
Stephen Dolan [Sun, 8 Dec 2013 17:46:23 +0000 (17:46 +0000)]
Refactor jv structure.

New structure layout is simpler and also faster.  In particular, it's
now small enough to be passed in registers on amd64.

11 years agoMake testsuite not leak when compiled with -DNDEBUG.
Stephen Dolan [Sun, 8 Dec 2013 17:44:54 +0000 (17:44 +0000)]
Make testsuite not leak when compiled with -DNDEBUG.

11 years agotest for losing memory on compile errors 231/head
David R. MacIver [Sun, 8 Dec 2013 16:19:12 +0000 (16:19 +0000)]
test for losing memory on compile errors

11 years agoargs to jq_compile_args were not getting freed when there were errors in the compile
David R. MacIver [Sun, 8 Dec 2013 15:28:29 +0000 (15:28 +0000)]
args to jq_compile_args were not getting freed when there were errors in the compile

11 years agoFix double-free typo in print_error()
Nicolas Williams [Sat, 7 Dec 2013 05:25:06 +0000 (23:25 -0600)]
Fix double-free typo in print_error()

11 years agoFix manual.yml
Nicolas Williams [Fri, 6 Dec 2013 17:58:55 +0000 (11:58 -0600)]
Fix manual.yml

11 years agoMerge pull request #224 from nicowilliams/features
Stephen Dolan [Thu, 5 Dec 2013 01:36:08 +0000 (17:36 -0800)]
Merge pull request #224 from nicowilliams/features

Features: more arity, string ops

11 years agoAdd self to AUTHORS 224/head
Nicolas Williams [Sat, 30 Nov 2013 08:31:47 +0000 (02:31 -0600)]
Add self to AUTHORS

11 years agoConditionally #define _GNU_SOURCE in compile.c
Nicolas Williams [Thu, 5 Dec 2013 00:14:31 +0000 (18:14 -0600)]
Conditionally #define _GNU_SOURCE in compile.c

11 years agoAdd tests for string index by string and builtins
Nicolas Williams [Mon, 2 Dec 2013 18:19:36 +0000 (12:19 -0600)]
Add tests for string index by string and builtins

11 years agoAdd index and rindex builtins
Nicolas Williams [Mon, 2 Dec 2013 18:19:23 +0000 (12:19 -0600)]
Add index and rindex builtins

11 years agoAdd index strings by string; return string indexes
Nicolas Williams [Mon, 2 Dec 2013 18:16:38 +0000 (12:16 -0600)]
Add index strings by string; return string indexes

    % jq '.[","]'
    "a,bc,def,ghij,klmno"
    [1,4,8,13]
    %

11 years agoMake length return abs value of numeric inputs
Nicolas Williams [Sat, 30 Nov 2013 08:29:21 +0000 (02:29 -0600)]
Make length return abs value of numeric inputs

11 years agoAdd callback interface for errors
Nicolas Williams [Sat, 30 Nov 2013 08:05:42 +0000 (02:05 -0600)]
Add callback interface for errors

Printing to stderr is not the right answer for a library.

11 years agoAdd jv_string_vfmt()
Nicolas Williams [Thu, 5 Dec 2013 00:14:10 +0000 (18:14 -0600)]
Add jv_string_vfmt()

11 years agoDocument ltrimstr and rtrimstr
Nicolas Williams [Sat, 30 Nov 2013 06:45:55 +0000 (00:45 -0600)]
Document ltrimstr and rtrimstr

11 years agoTest ltrimstr and rtrimstr functions
Nicolas Williams [Sat, 30 Nov 2013 06:44:30 +0000 (00:44 -0600)]
Test ltrimstr and rtrimstr functions

11 years agoAdd ltrimstr and rtrimstr functions
Nicolas Williams [Sat, 30 Nov 2013 06:44:14 +0000 (00:44 -0600)]
Add ltrimstr and rtrimstr functions

11 years agoDocument -u / --unslurp option
Nicolas Williams [Fri, 29 Nov 2013 23:43:40 +0000 (17:43 -0600)]
Document -u / --unslurp option

11 years agoAdd -I / --online-input for huge top-level arrays
Nicolas Williams [Fri, 29 Nov 2013 23:41:04 +0000 (17:41 -0600)]
Add -I / --online-input for huge top-level arrays

11 years agoDocument -e / --exit-status argument
Nicolas Williams [Fri, 29 Nov 2013 22:39:02 +0000 (16:39 -0600)]
Document -e / --exit-status argument

11 years agoAdd -e | --exit-status CLI option
Nicolas Williams [Fri, 29 Nov 2013 22:36:15 +0000 (16:36 -0600)]
Add -e | --exit-status CLI option

11 years agoDocument tojson and fromjson builtins
Nicolas Williams [Fri, 29 Nov 2013 22:26:52 +0000 (16:26 -0600)]
Document tojson and fromjson builtins

11 years agoTest tojson and fromjson
Nicolas Williams [Fri, 29 Nov 2013 22:20:50 +0000 (16:20 -0600)]
Test tojson and fromjson

11 years agoAdd tojson and fromjson builtins
Nicolas Williams [Fri, 29 Nov 2013 22:16:52 +0000 (16:16 -0600)]
Add tojson and fromjson builtins

11 years agoDocument split function
Nicolas Williams [Fri, 29 Nov 2013 19:29:25 +0000 (13:29 -0600)]
Document split function

11 years agoDocument string multiplication and division
Nicolas Williams [Fri, 29 Nov 2013 19:26:54 +0000 (13:26 -0600)]
Document string multiplication and division

11 years agoDocument string functions and slicing
Nicolas Williams [Fri, 29 Nov 2013 19:19:10 +0000 (13:19 -0600)]
Document string functions and slicing

11 years agoTest string slicing
Nicolas Williams [Fri, 29 Nov 2013 18:50:21 +0000 (12:50 -0600)]
Test string slicing

11 years agoAdd string slicing
Nicolas Williams [Fri, 29 Nov 2013 18:50:02 +0000 (12:50 -0600)]
Add string slicing

11 years agoAdd tests for string division/splitting
Nicolas Williams [Fri, 29 Nov 2013 04:36:14 +0000 (22:36 -0600)]
Add tests for string division/splitting

11 years agoAdd string division by string (split on separator)
Nicolas Williams [Fri, 29 Nov 2013 04:27:23 +0000 (22:27 -0600)]
Add string division by string (split on separator)

11 years agoTest starts/endswith and string multiplication
Nicolas Williams [Fri, 29 Nov 2013 21:51:51 +0000 (15:51 -0600)]
Test starts/endswith and string multiplication

11 years agoAdd string multiplication by number
Nicolas Williams [Fri, 29 Nov 2013 21:49:11 +0000 (15:49 -0600)]
Add string multiplication by number

11 years agoAdd startswith/endswith
Nicolas Williams [Thu, 28 Nov 2013 21:17:32 +0000 (15:17 -0600)]
Add startswith/endswith

11 years agoAdd explode/implode jq functions to match jv API
Nicolas Williams [Thu, 28 Nov 2013 20:53:50 +0000 (14:53 -0600)]
Add explode/implode jq functions to match jv API

11 years agoUse uint32_t for codepoint in jv_string_append_codepoint()
Nicolas Williams [Thu, 28 Nov 2013 20:53:05 +0000 (14:53 -0600)]
Use uint32_t for codepoint in  jv_string_append_codepoint()

11 years agoAdd jv string utility functions
Nicolas Williams [Thu, 28 Nov 2013 20:48:46 +0000 (14:48 -0600)]
Add jv string utility functions

    jv_string_empty()
        -> return an empty string with given allocated length (for fast
           appends)
    jv_string_append_codepoint
        -> append a single codepoint (int) to the given string
    jv_string_explode
        -> return an array of codepoints making up a string
    jv_string_implode
        -> return the UTF-8 encoding of an array of codepoint numbers

11 years agoSupport more arguments for defs
Nicolas Williams [Thu, 28 Nov 2013 19:04:29 +0000 (13:04 -0600)]
Support more arguments for defs

11 years agoPreserve insertion order in objects. Closes #169.
Stephen Dolan [Wed, 4 Dec 2013 22:30:39 +0000 (22:30 +0000)]
Preserve insertion order in objects. Closes #169.

11 years agoAdd a few more test cases (from the man page)
Nicolas Pouillard [Mon, 11 Nov 2013 01:59:27 +0000 (02:59 +0100)]
Add a few more test cases (from the man page)

Signed-off-by: Nicolas Williams <nico@cryptonector.com>
11 years agoAdd a --unbuffered option. Closes #206
Stephen Dolan [Fri, 8 Nov 2013 12:19:41 +0000 (12:19 +0000)]
Add a --unbuffered option. Closes #206

11 years agoMerge pull request #210 from Habbie/patch-1
Stephen Dolan [Fri, 8 Nov 2013 11:43:57 +0000 (03:43 -0800)]
Merge pull request #210 from Habbie/patch-1

count should be length

11 years agocount should be length 210/head
Peter van Dijk [Thu, 7 Nov 2013 15:39:44 +0000 (16:39 +0100)]
count should be length

Example refers to a count function, which does not exist. Replacing it with length works.

11 years agoMerge pull request #193 from ryo1kato/fix-docs
Stephen Dolan [Thu, 7 Nov 2013 12:41:01 +0000 (04:41 -0800)]
Merge pull request #193 from ryo1kato/fix-docs

Docs: add description of --from-file option

11 years agoFix a crash on group_by of empty list. Fixes #208.
Stephen Dolan [Thu, 7 Nov 2013 12:18:48 +0000 (12:18 +0000)]
Fix a crash on group_by of empty list. Fixes #208.

11 years agoDocs: add description of --from-file option 193/head
Ryoichi KATO [Wed, 16 Oct 2013 12:42:29 +0000 (21:42 +0900)]
Docs: add description of --from-file option

11 years agoMerge pull request #188 from Juanxo/patch-1
Stephen Dolan [Mon, 7 Oct 2013 13:59:50 +0000 (06:59 -0700)]
Merge pull request #188 from Juanxo/patch-1

Fix typo on error message

11 years agoFix typo on error message 188/head
Juan Guerrero [Sun, 6 Oct 2013 15:52:04 +0000 (17:52 +0200)]
Fix typo on error message

11 years agoMerge pull request #185 from qoelet/master
Stephen Dolan [Fri, 20 Sep 2013 13:05:42 +0000 (06:05 -0700)]
Merge pull request #185 from qoelet/master

Add missing -i flag in build instructions

11 years agoAdd missing -i flag in build instructions 185/head
Kenny Shen [Fri, 20 Sep 2013 02:34:57 +0000 (10:34 +0800)]
Add missing -i flag in build instructions

11 years agoMerge pull request #182 from mdaines/sqrt-builtin
Stephen Dolan [Sat, 14 Sep 2013 23:34:52 +0000 (16:34 -0700)]
Merge pull request #182 from mdaines/sqrt-builtin

Add builtin for calculating square root

11 years agoAdd test showing calculation of standard deviation 182/head
Michael Daines [Sat, 14 Sep 2013 21:48:19 +0000 (17:48 -0400)]
Add test showing calculation of standard deviation

11 years agoMerge branch 'libjq'
Stephen Dolan [Sat, 14 Sep 2013 18:30:39 +0000 (19:30 +0100)]
Merge branch 'libjq'

Conflicts:
Makefile.am
configure.ac

11 years agoMerge pull request #181 from mdaines/patch-1
Stephen Dolan [Fri, 13 Sep 2013 22:24:22 +0000 (15:24 -0700)]
Merge pull request #181 from mdaines/patch-1

Fix typo

11 years agoFix typo 181/head
Mike Daines [Fri, 13 Sep 2013 16:15:52 +0000 (12:15 -0400)]
Fix typo

11 years agoMerge pull request #171 from joelittlejohn/fix-makefile
Stephen Dolan [Fri, 13 Sep 2013 16:02:42 +0000 (09:02 -0700)]
Merge pull request #171 from joelittlejohn/fix-makefile

Fix Makefile after refactoring of stacks in 05d90517b02

11 years agoMerge pull request #175 from lipidity/fix-build
Stephen Dolan [Fri, 13 Sep 2013 16:02:24 +0000 (09:02 -0700)]
Merge pull request #175 from lipidity/fix-build

Call AM_INIT_AUTOMAKE once only