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

331 Commits

Author SHA1 Message Date
Stephen Dolan
89caf46a5f Update URLs from stedolan to jqlang 2023-05-28 17:06:31 +01:00
Mattias Wadman
cff5336ec7 docs: Document repeat(exp) 2022-05-26 16:04:32 -05:00
Mattias Wadman
f2ad9517c7 Mention -n in IO-section and for input/inputs 2022-05-26 16:02:50 -05:00
Naïm Favier
174db0f935 docs: point to Libera.Chat instead of Freenode 2022-05-26 16:01:25 -05:00
Sean Wei
55e6e2c218 Add --recursive to git clone 2022-05-26 15:47:24 -05:00
Zhaohui Mei
88116ba76d docs(manual): fix the typo errors in the manual 2022-05-26 15:47:02 -05:00
Mattias Wadman
3678822e7f docs: Fix some format inconsistencies in manual 2022-05-26 15:46:40 -05:00
Gijs Kunze
0171a9eb60 fixes incorrect example in man page 2022-05-26 15:45:52 -05:00
dak180
edacc8f70d jq is now available through fink. 2022-05-26 15:45:08 -05:00
Mattias Wadman
cc4efc49e1 Fix incorrect if empty string example 2021-05-01 14:33:01 -04:00
mjarosie
e615bdc407 update the version available through Chocolatey 2021-05-01 14:32:38 -04:00
Aleksey Tsalolikhin
9600a5c781 Re-apply patch from ff8924ce16 to dev manual 2021-05-01 14:19:45 -04:00
Aleksey Tsalolikhin
d57d9737d7 Remove decimal number text from v1.6 manual 2021-05-01 14:19:45 -04:00
Alexandre Jasmin
80052e5275 Fix #2197 extended regex pattern example 2020-12-18 00:01:19 -05:00
Maximilian Roos
a17dd3248a Add some missing code quoting to the manual 2020-06-08 12:35:13 -04:00
Gustav
d24c3d2263 Change Homebrew version in docs to 1.6 2020-03-02 10:10:08 -05:00
Alanscut
5b9e63e4af fix typos 2020-01-14 10:18:22 -06:00
Bernard Niset
087100183c Add information on how to install on OS X with MacPorts 2020-01-07 23:35:19 -06:00
William Chargin
baecf2ce9e docs: --indent value has maximum of 7, not 8
Test Plan:
To verify that this is in fact the behavior:

```
$ jq --indent 7 -n '[1]'
[
       1
]
$ jq --indent 8 -n '[1]'
jq: --indent takes a number between -1 and 7
Use jq --help for help with command-line options,
or see the jq manpage, or online docs  at https://stedolan.github.io/jq
```

This patch was generated by running `git grep "no more than"` and fixing
up appropriate results.

wchargin-branch: docs-fix-indent-bounds
2020-01-07 23:34:52 -06:00
Alanscut
e7d37983c4 outputing -> outputting 2020-01-03 09:56:04 -06:00
David Biesack
07b18a33fe Update other manual and source to use ;37 2020-01-02 15:47:26 -06:00
David Biesack
cf615152e1 correct the default JQ_COLORS to use 37, not undefined color 39 2020-01-02 15:47:26 -06:00
Alanscut
fa3733cc4c fix typos 2020-01-02 10:52:12 -06:00
Paul Wise
24564b2d34 Add -0 / --nul-output option for processing values containing newlines
Closes: https://github.com/stedolan/jq/issues/1271
2019-12-30 15:37:14 -06:00
Felix Wolfsteller
707022b0e5 Rephrase doc "A string B is contained in A" ...
Minor rephrasing to prevent read/brain backtracking when using capital letter A as an article and a variable term.
2019-12-29 23:52:47 -06:00
Leonid S. Usov
cf4b48c7ba Save literal value of the parsed number to preserve it for the output
Extend jv_number to use decNumber for storing number literals. Any math
operations on the numbers will truncate them to double precision.
Comparisons when both numbers are literal numbers will compare them
without truncation.

Delay conversion of numbers to doubles until a math operation is performed,
to preserve precision. A literal jv_number will only need conversion to
double once, and will reuse the resultant double on subsequent
conversions.

Outputting literal jv_numbers preserves the original precision.

Add strong pthread requirement to manage contexts/allocations for
converting numbers between their decNumber, string, and double formats.
2019-10-22 14:11:04 -04:00
Leonid S. Usov
b6be13d5de Add decNumber library
The library adds support for decimal numbers of arbitrary length.
Downloaded from ICU, under ICU 1.8.1 license
http://download.icu-project.org/files/decNumber/decNumber-icu-368.zip
2019-10-22 14:11:04 -04:00
Eli Schwartz
78774647e1 docs: fix seriously dangerous download instructions for Arch Linux
The current instructions tell users to perform two actions:
- update the package database
- install the jq package

The only thing users need to or should be doing is actually installing
the jq package -- regardless of which version is being installed.
Guidelines on how to perform system updates are massively out of scope.

In the case of partially performing a system update as a prerequisite
for installing jq, the official guidance from Arch Linux is not to do
this: partial updates are not supported, we refuse to support them, and
anyone who does try to perform them anyway is assumed to know so much
about their system that they clearly do not ever need help from anyone
else (which is a good thing since they won't get it). The result is a
frankensteined system that can only ever be supported by the person who
frankensteined it to begin with. The only reason the package manager
even allows it to occur in the first place is because other
distributions using pacman might have different LTS policies, and
because it would prevent expert users from being in control of their
system, as per the traditional Unix philosophy:

"Unix was not designed to stop you from doing stupid things, because
that would also stop you from doing clever things."

Consequences of performing partial updates without understanding the
ramifications in extensive detail can include breaking the partially
updated application (jq), breaking any application that shares a mutual
dependency with the partially updated application (which jq is *lucky*
to only depend on the ever-backwards-compatible glibc), or breaking the
entire operating system by leaving armed traps behind for the next time
a `pacman -S new-package` is executed and thereby breaks *its* cascading
dependencies.

See:
https://wiki.archlinux.org/index.php/System_maintenance#Partial_upgrades_are_unsupported
2019-07-21 14:40:47 -04:00
Helmut K. C. Tessarek
8d9817d2f7 clarify filter usage
The current paragraph is not complete, since a digit is not a special character.

Changing it to:

    If the key contains special characters or starts with a digit,
    you need to surround it with double quotes like this:
    `."foo$"`, or else `.["foo$"]`.
2019-07-08 21:02:43 -04:00
Nicolas Williams
0dab2b18d7 Add -b / --binary option for Windows 2019-03-24 23:23:16 -05:00
William Langford
175dbc4e25 Remove ruby dependency from manpage build 2019-02-26 11:10:38 -06:00
William Langford
c1f11855e3 Remove ruby dependency from website build 2019-02-26 11:10:38 -06:00
Nicolas Williams
048acee39b Fix if-then-else example formatting 2019-02-20 20:03:26 -06:00
Nicolas Williams
8a02b2c9c1 Document optional else clause of if 2019-02-20 20:03:26 -06:00
William Langford
4b4fefa254 Merge pull request #1774 from dooglus/patch-1
Fix grammar typo.
2019-01-05 16:04:30 -05:00
Nicolas Williams
8ea4a5584e Allow variable refs as object keys {$key:value}
Users are often surprised by the requirement to parenthesize any
non-trivial object key expressions in object constructors.  E.g.,
{"a"+"b":1}.  This commit adds one more kind of key expression besides
literals and idents: variable references.

A common use case for this is jq programs as JSON templates to fill in
with variables computed from inputs or passed in on the command-line.
E.g., {some_key:$value}.  Now users can also use, e.g., {$key:$value}.

This and the restrictions on key and value expressions in object
constructors are now clarified a bit in the documentation.
2018-12-10 21:54:59 -06:00
Chris Moore
9caa1ba146 Fix grammar typo.
'operator' needs to be plural here.
2018-11-29 05:44:05 -08:00
William Langford
2f2d05b087 Minor website fixes for 1.6 2018-11-02 08:15:18 -04:00
William Langford
3daecb246a Update website with details for jq-1.6 2018-11-01 21:48:34 -04:00
William Langford
cd4f61aee6 Fix website whitespace 2018-10-21 23:28:43 -04:00
William Langford
39a3e2c46f Add documentation for destructuring alternation 2018-10-21 23:28:43 -04:00
Riley Avron
ae11f111a5 Fix "provides" typo 2018-02-23 14:10:47 -06:00
Paul Chvostek
bd34b8dd2e fix FreeBSD install instructions 2018-01-04 15:50:20 -06:00
David Fetter
b4742c1257 Added rawfile
In passing, clean remnants of argfile from slurpfile docs.
2017-12-11 12:17:17 -06:00
Nicolas Williams
9a4576e756 Revert "reduce: handle empty updates (fix #1313)"
This reverts commit e24af3c78e.

While the semantics are desirable, there is no way to implement them
efficiently.  The reason is that in order to handle backtracking (empty)
from the state update expression, we have to retain a reference to the
reduction state value in order to restore it upon backtracking.
Retaining a reference to the reduction state kills performance by
causing lots of additional memory allocations and garbage because the
input to the update expression will always have at least two references,
thus no changes to it can be done in-place, and all changes end up being
CoW changes.

Avoiding this is the very reason for the LOADVN instruction (leaving
`null` in the variable loaded from).
2017-12-11 11:20:16 -06:00
William Langford
0c9eacedaa Actually fix the strptime tests
This has been a complicated issue to fix for a number of reasons.
The core of it is that the behavior is different between different
versions of macOS, some of which set possible-but-incorrect values.

This commit addresses the issue by always using our computation for
tm_wday and tm_yday on macOS. As a side-effect, strptime format
strings that specify %u and %j will no longer work on macOS.
2017-11-29 20:47:56 -05:00
trantor
bdaddcf107 Typo correction
Suppresion -> Suppression
2017-11-22 13:47:35 -05:00
Nicolas Williams
c538237f4e Deal with strptime() on OS X and *BSD (fix #1415)
strptime() on OS X and *BSDs (reputedly) does not set tm_wday and
tm_yday unless corresponding %U and %j format specifiers were used.
That can be... surprising when one parsed year, month, and day anyways.
Glibc's strptime() conveniently sets tm_wday and tm_yday in those cases,
but OS X's does not, ignoring them completely.

This commit makes jq compute those where possible, though the day of
week computation may be wrong for dates before 1900-03-01 or after
2099-12-31.
2017-05-21 16:24:48 -05:00
Nico Williams
6d89e297fe Add JQ_COLORS env var for color config (fix #1252) 2017-04-29 14:00:52 -04:00
pkoppstein
4b4cf789e0 def isempty(g) # Testing 'isempty(empty)' at line number 1364 2017-04-15 16:45:00 -05:00