1
0
mirror of https://github.com/jqlang/jq.git synced 2025-08-01 01:24:24 +03:00

447 Commits

Author SHA1 Message Date
b9e19de76e Update jq documentation for jq 1.8.1 release 2025-07-01 20:54:28 +09:00
11f43e9d93 Fixed minor typo in docs (#3359) 2025-06-30 07:31:28 +09:00
62cafa2367 Update jq documentation for jq 1.8.0 release (#3333) 2025-06-01 16:38:16 +09:00
3b00981acd Fix quotes in 1.7 manual for ease of taking diff between versions (#3329) 2025-05-31 11:31:54 +09:00
7d8c096e48 Add trimstr/1 function (#3319) 2025-05-21 18:46:04 +09:00
c350566001 Adds "toboolean" builtin function for converting strings to booleans (#2098) 2025-05-18 16:31:10 +09:00
b088e83a82 Refactor splits/2 using foreach syntax (remove private filter _nwise) (#3260)
This commit refactors `splits/2` implementation using `foreach` syntax
and reduces intermediate arrays. This refactoring removes an unnecessary
private (and undocumented) filter `_nwise` and closes #3148.
2025-05-18 08:27:44 +09:00
931a362f8b docs: Use a better input example in the streaming section (#3322)
The introduction says all the usage examples (e.g. of truncate_stream,
etc) in the section use [0,[1]] as input, but they actually use [1,[2]].
["a",["b"]] seems better than [1,[2]] as the string values won't be
confusable with the indexes in <path>.
2025-05-14 20:46:31 +09:00
fa6a2ff688 website: remove unused root path on building website (#3248)
We no longer use the `--root` option of `build_website.py` since we have
moved to jqlang.org (from jqlang.github.io/jq where the root was `/jq`).
We don't need the option on local development either since `http.server`
has the `-d` option to specify the directory to serve from.
2025-02-06 22:42:27 +09:00
6ce3bdf382 fix: preserve numerical precision on unary negation (#3242) 2025-02-06 07:50:21 +09:00
ce54621904 docs: mention the behavior of scan using regex with capturing groups (#3240) 2025-01-28 11:41:17 +09:00
da28628edd Fix redundant subexpression in Generators and iterators example in doc (#3239) 2025-01-27 19:45:27 +09:00
18bd8374c1 Escape some code parts in manual. (#3184) 2025-01-25 21:55:06 +09:00
a7b22539a4 fix: make last(empty) yield no output values (#3179) 2024-11-13 20:35:50 +09:00
32a304b912 Clarify -f argument parsing (#3199) 2024-11-09 15:48:24 +01:00
eb9bdca296 Remove outdated FIXME
This comment predates the addition of $ARGS in jq 1.6, so there was no
way to access named arguments with an invalid identifier. Rather than
forbid such names, update the manual to clarify.
2024-11-08 19:07:55 +01:00
0558e77e8c Add --library-path long option for -L
-L is the only option without a long form.
2024-11-08 19:07:55 +01:00
1bebd23aad add skip/2 as the counterpart to limit/2 (#3181)
I also changed the behavior of limit/2 with negative count to emit an error, like nth/2 does.
Also, I redefined nth/2 using skip/2 to minimize the impact of growth of builtin filters.
2024-10-06 08:25:38 +09:00
860af44fee Fix typos (#3173) 2024-09-13 18:30:49 +09:00
37f4cd2648 Fix docs for strptime(fmt) (#3164) 2024-08-27 10:59:43 +09:00
6322b99252 fix: find and source ~/.jq file on windows (fixes #3104) (#3114) 2024-08-24 08:44:08 +09:00
0e0cdd552e feat: uri decode function (#3161) 2024-08-22 08:07:24 +09:00
0b5ae30f19 Implement add/1 (#3144) 2024-08-20 21:02:24 +09:00
c1d885b024 website: Make latest release (1.7) be default manual (#3130)
Fixes issue with confusion about features that has not been
released yet.

Move deveopment manual.yml to dev/manual.yml
Symlink manual.yml to v1.7/manual.yml
Refactor to share history header with links to other manual versions.
Change man.test and man page generation to use dev/manual.yml

Related to #3078 #3127
2024-07-12 17:43:02 +02:00
6d02d53f51 Make tests pass when --disable-decnum 2024-05-15 12:48:00 -05:00
be437ec049 Add trim/0, ltrim/0 and rtrim/0 that trims leading and trailing whitespace (#3056) 2024-03-20 11:04:17 +01:00
81f4f883ac Remove non-standard pow10 filter in favor of exp10 (#3059)
The pow10 function was a glibc extension removed in 2.27. Use exp10 filter instead.
2024-03-20 18:23:08 +09:00
913b26469f docs: Update chocolatey install command in default.yml (#3042) 2024-02-13 16:50:58 +01:00
92d35378ff Fix typo in documentation for map_values (#3035)
* Fix typo in documentation for map_values

"map_value(f)" -> "map_values(f)"

* map_value => map_values also in the devolpment manual

---------

Co-authored-by: Emanuele Torre <torreemanuele6@gmail.com>
2024-02-08 13:52:50 +00:00
13e02ba348 docs: rename example jq utility to total
Apparently sum(1) is a BSD and GNU coreutil used to compute the
"16-bit BSD checksum" of a file.
2024-01-30 12:23:33 -06:00
1daabc67ed typo contruct->construct (#3017) 2024-01-25 22:21:41 +01:00
c95f6ce700 Fix "in the a search" typo (#3015)
Fixes #3014
2024-01-24 23:34:41 +01:00
71e7bcdfc1 Revert "lexer: temporarily revert #\ patch; keep CR in comment bug fix"
This reverts commit 5d95791a67.
2024-01-16 16:08:03 -06:00
701c880805 Add jq 1.7.1 news item (#3004) 2023-12-26 15:22:39 +09:00
0b922725b1 Fix typo (#3002) 2023-12-24 11:22:20 +01:00
e011f003b6 Add jq 1.7.1 to webpage (#3003)
Make it the default download
2023-12-24 11:17:21 +01:00
5d95791a67 lexer: temporarily revert #\ patch; keep CR in comment bug fix
This commit temporarily reverts the commit that allows #\ "tcl-style"
comments everywhere and documents them, for the 1.7.1 patch release
cca1f7d18f.

\r is removed from the list of characters not allowed in a comment to
preserve that bugfix.
2023-12-13 16:38:18 +01:00
2ccab044fe chore: Improve readability (for Alternative operator '//')
The description of the Alternative operator `//` was hard for me to grasp in its wording.

I suggest dividing the looong sentence into two parts. Since it is actually an alternative formulation, the sentence can be divided into the first formulation, and the alternative formulation.
2023-12-11 11:38:54 +00:00
1617091033 website: use https URLs instead of http URLs in download page
Also add markdown formatting for decNumber URL so it gets rendered as a
link in the html page.
2023-11-29 09:35:36 +01:00
cca1f7d18f Comment bug fixes, and fully support Tcl-style multiline comments
* bugfix: comments were incorrectly being terminated by CR; for example
    jq -n $'1 #foo\r'
  fails to compile because the CR character terminates the comment, and
  CR is not a valid character in jq syntax.

* improvement: comments fully support Tcl-style line continuation.
  Previously this was only "supported" in `-f' scripts, whose first line
  starts with "#!", and second line starts with # and ends with \, only
  for the comment on the second line, only for one extra line.

* man: document comment syntax, which was previously undocumented.

* tests: add regression tests for the bugfix, and some tests for line
  continuation in comments.
2023-11-03 15:52:02 -05:00
4ebd21e1eb Allow passing the inline jq script before --
jq previously only allowed passing the inline script before -- (as if
they were options) even though one would expect the inline script to be
a positional argument.

Since jq previously also refused to run with a usage error if the script
was passed after -- (It was not assuming  .  as script as it does when
no arguments are passed), and positional arguments are allowed before --
and even before other options, it should not be a breaking change to
change that weird behaviour, and allow the script to appear after --.

It also simplifies the option parsing code a bunch.

Fixes #2918
2023-10-04 00:00:46 -05:00
7f547827e4 Simplify pick example
Old pick example included input array in command line, making `input` confusing
and redundant.
2023-10-03 22:48:12 +02:00
8f81668014 Fix the default colors to use 39, the default foreground color (#2904) 2023-09-22 09:18:41 +09:00
806475da29 Update webpage with 1.7 release (#2879)
* Update webpage with 1.7 release

Update webpage with 1.7 release

* Update docs/content/download/default.yml

Co-authored-by: itchyny <itchyny@cybozu.co.jp>

* Update docs/templates/index.html.j2

Co-authored-by: itchyny <itchyny@cybozu.co.jp>

* Update docs/content/download/default.yml

Co-authored-by: itchyny <itchyny@cybozu.co.jp>

* Don't mention 1.7rc signatures

* Add link to 1.7 manual

* binaries -> binary

* AMD 32-bit to i386

* Standarize arch types to AMD64, ARM64 & i386 in download page

---------

Co-authored-by: itchyny <itchyny@cybozu.co.jp>
2023-09-07 10:54:10 -07:00
583e4a2718 Add --config option printing ./configure options used 2023-08-19 17:40:08 -05:00
0733fd3d58 Add a regression test for negative indices and fix a pick/1 test 2023-08-16 17:49:44 -05:00
f31c180e8f Update documentation to reflect new defs field on modulemeta 2023-08-12 20:46:36 -05:00
d1a6da2205 docs: fix delpaths description 2023-08-09 18:20:04 +02:00
a692060129 Change the default color of null to Bright Black 2023-08-05 23:21:12 -05:00
f94a9d463f Let error(null) throw null
This patch removes the weird behaviour of jv_invalid_with_msg(jv_null())
that returns jv_invalid() (i.e. empty), instead of a boxed jv_null().

The previous behaviour of  null|error  was obviously unintentional, and
allowing is jv_invalid_with_msg() to return values on which you can't
call jv_invalid_get_msg() is only error prone.
2023-08-04 17:38:52 -05:00