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

Add debug builtin

And refactor setup of jv dump flags.
This commit is contained in:
Nicolas Williams
2014-12-27 17:15:56 -06:00
parent a9c613e87d
commit 5df20f4954
5 changed files with 65 additions and 17 deletions

View File

@@ -2226,6 +2226,12 @@ sections:
jq itself. These two builtins, and jq's own reading actions, can
be interleaved with each other.
One builtin provides minimal output capabilities, `debug`.
(Recall that a jq program's output values are always output as
JSON texts on `stdout`.) The `debug` builtin can have
application-specific behavior, such as for executables that use
the libjq C API but aren't the jq executable itself.
- title: "`input`"
body: |
@@ -2239,6 +2245,14 @@ sections:
This is primarily useful for reductions over a program's
inputs.
- title: "`debug`"
body: |
Causes a debug message based on the input value to be
produced. The jq executable wraps the input value with
`["DEBUG:", <input-value>]` and prints that and a newline on
stderr, compactly. This may change in the future.
- title: Assignment
body: |