5 Commits
Author SHA1 Message Date
qodelicious 49fbca1242 docs: explain that semicolons separate function arguments (#3685)
The manual's "Defining Functions" section shows only one-argument
functions, so it never says how to pass more than one. This adds a short
paragraph: arguments are separated by `;` in both `def f(a; b):` and
`f(.x; .y)`, and `f(.x, .y)` instead calls a one-argument `f` with the
filter `.x, .y`. It also adds an example for each. `tests/man.test` and
`jq.1.prebuilt` are regenerated.

Fixes #2163
2026-10-22 20:24:55 +02:00
qodelicious e440cccc0a docs: fix arithmetic update-assignment equivalence (#3682)
The manual said `a op= b` is equivalent to `a |= . op b`. It is actually
equivalent to `(b as $b | a |= . op $b)`: the right-hand side gets `.`
as input, not the value being updated, and each value it outputs gives a
separate result.

This updates the description and adds two examples, `.a += .b` and `.a
+= (1,2)`. `tests/man.test` and `jq.1.prebuilt` are regenerated.

Fixes #2119, fixes #2407
2026-10-22 20:23:52 +02:00
qodelicious 4b45d6c1ba docs: print one example output per line in the man page (#3683) 2026-10-21 21:34:38 +09:00
qodelicious ec0e2f3f94 docs: mention conda-forge on the download page (#3684) 2026-10-20 22:25:13 +09:00
qodelicious 04042494cf Exit with the given status for negative halt_error codes (#3660)
halt_error with a negative exit code did not exit with that code. The
code collided with the internal status values for null or false output
and for no output, so halt_error(-1) exited with 0, or with 1 under
--exit-status.

Keep the low 8 bits of a negative code, as exit(3) does on POSIX
systems, so halt_error(-1) now exits with 255 and halt_error(-2) with
254, the same with or without --exit-status. Under --exit-status this
replaces the previous absolute value, so halt_error(-2) used to exit
with 2 and halt_error(-255) with 255, and they now exit with 254 and 1.
2026-10-10 21:26:02 +09:00