Skip to content

Commit

Permalink
Document changes to exec/2 and system/2
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmicToast committed May 31, 2024
1 parent 9aa3bcc commit 1e6a2b8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
25 changes: 17 additions & 8 deletions docs/content/manual/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3272,10 +3272,11 @@ sections:
decoration, not even a newline.
Additionally, jq has support for executing "external filters" provided by
other executables. This functionality is provided by `exec`, but may not
be available on all platforms, and does not necessarily integrate well
with other jq features. It is intended to perform smaller processing that
is otherwise impossible to perform in jq itself.
other executables. This functionality is provided by `exec` and related
filters viz. `system`, but may not be available on all platforms, and does
not necessarily integrate well with other jq features. It is intended to
perform smaller processing that is otherwise impossible to perform in jq
itself.
Most jq builtins are referentially transparent, and yield constant
and repeatable value streams when applied to constant inputs.
Expand Down Expand Up @@ -3354,10 +3355,18 @@ sections:
body: |
Spawns a new process of path with arguments args. Pipes its input
converted to a string as the stdin of the process. The output of the
process is coalesced and outputted as a string. Note that this output
will include any terminating newlines, so you may want to add an
rtrim after this filter, or use a wrapper.
converted to a string as the stdin of the process. Outputs an object
like `{'out': "", "err": "", "status": 0}`, containing the stdout,
stderr, and exit code of the process respectively. If the process
exits abnormally due to an unhandled signal, it will have a status of
"-1" and a "signal" parameter giving the numeric value of the signal
that caused the process to terminate.
- title: "`system(path)`, `system(path; [args…])`"
body: |
Exactly equivalent to an `exec` call with the same arguments, followed
by `| .out | rtrim`.
- title: 'Streaming'
body: |
Expand Down
7 changes: 5 additions & 2 deletions jq.1.prebuilt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1e6a2b8

Please sign in to comment.