Reorder the command line options in the manual (#2766)
This commit is contained in:
1 parent
8f49600a6b
commit
4705a22c7d
7 files changed
+440
-418
No files matched your search
@@ -93,34 +93,30 @@ sections:
|
||||
You can affect how jq reads and writes its input and output
|
||||
using some command-line options:
|
||||
|
||||
* `--version`/`-V`:
|
||||
* `--null-input` / `-n`:
|
||||
|
||||
Output the jq version and exit with zero.
|
||||
Don't read any input at all. Instead, the filter is run once
|
||||
using `null` as the input. This is useful when using jq as a
|
||||
simple calculator or to construct JSON data from scratch.
|
||||
|
||||
* `--slurp`/`-s`:
|
||||
|
||||
Instead of running the filter for each JSON object in the
|
||||
input, read the entire input stream into a large array and run
|
||||
the filter just once.
|
||||
|
||||
* `--online-input`/`-I`:
|
||||
|
||||
When the top-level input value is an array produce its elements
|
||||
instead of the array. This allows on-line processing of
|
||||
potentially very large top-level arrays' elements.
|
||||
|
||||
* `--raw-input`/`-R`:
|
||||
* `--raw-input` / `-R`:
|
||||
|
||||
Don't parse the input as JSON. Instead, each line of text is
|
||||
passed to the filter as a string. If combined with `--slurp`,
|
||||
then the entire input is passed to the filter as a single long
|
||||
string.
|
||||
|
||||
* `--null-input`/`-n`:
|
||||
* `--slurp` / `-s`:
|
||||
|
||||
Don't read any input at all! Instead, the filter is run once
|
||||
using `null` as the input. This is useful when using jq as a
|
||||
simple calculator or to construct JSON data from scratch.
|
||||
Instead of running the filter for each JSON object in the
|
||||
input, read the entire input stream into a large array and run
|
||||
the filter just once.
|
||||
|
||||
* `--online-input` / `-I`:
|
||||
|
||||
When the top-level input value is an array produce its elements
|
||||
instead of the array. This allows on-line processing of
|
||||
potentially very large top-level arrays' elements.
|
||||
|
||||
* `--compact-output` / `-c`:
|
||||
|
||||
@@ -128,11 +124,12 @@ sections:
|
||||
will result in more compact output by instead putting each
|
||||
JSON object on a single line.
|
||||
|
||||
* `--color-output` / `-C` and `--monochrome-output` / `-M`:
|
||||
* `--raw-output` / `-r`:
|
||||
|
||||
By default, jq outputs colored JSON if writing to a
|
||||
terminal. You can force it to produce color even if writing to
|
||||
a pipe or a file using `-C`, and disable color with `-M`.
|
||||
With this option, if the filter's result is a string then it
|
||||
will be written directly to standard output rather than being
|
||||
formatted as a JSON string with quotes. This can be useful for
|
||||
making jq filters talk to non-JSON-based systems.
|
||||
|
||||
* `--ascii-output` / `-a`:
|
||||
|
||||
@@ -142,37 +139,27 @@ sections:
|
||||
ASCII output with every non-ASCII character replaced with the
|
||||
equivalent escape sequence.
|
||||
|
||||
* `--sort-keys` / `-S`:
|
||||
|
||||
Output the fields of each object with the keys in sorted order.
|
||||
|
||||
* `--color-output` / `-C` and `--monochrome-output` / `-M`:
|
||||
|
||||
By default, jq outputs colored JSON if writing to a
|
||||
terminal. You can force it to produce color even if writing to
|
||||
a pipe or a file using `-C`, and disable color with `-M`.
|
||||
|
||||
* `--unbuffered`:
|
||||
|
||||
Flush the output after each JSON object is printed (useful if
|
||||
you're piping a slow data source into jq and piping jq's
|
||||
output elsewhere).
|
||||
|
||||
* `--sort-keys` / `-S`:
|
||||
|
||||
Output the fields of each object with the keys in sorted order.
|
||||
|
||||
* `--raw-output` / `-r`:
|
||||
|
||||
With this option, if the filter's result is a string then it
|
||||
will be written directly to standard output rather than being
|
||||
formatted as a JSON string with quotes. This can be useful for
|
||||
making jq filters talk to non-JSON-based systems.
|
||||
|
||||
* `-f filename` / `--from-file filename`:
|
||||
|
||||
Read filter from the file rather than from a command line, like
|
||||
awk's -f option. You can also use '#' to make comments.
|
||||
|
||||
* `-e` / `--exit-status`:
|
||||
|
||||
Sets the exit status of jq to 0 if the last output value was
|
||||
neither `false` nor `null`, 1 if the last output value was
|
||||
either `false` or `null`, or 4 if no valid result was ever
|
||||
produced. Normally jq exits with 2 if there was any usage
|
||||
problem or system error, 3 if there was a jq program compile
|
||||
error, or 0 if the jq program ran.
|
||||
|
||||
* `--arg name value`:
|
||||
|
||||
This option passes a value to the jq program as a predefined
|
||||
@@ -187,6 +174,23 @@ sections:
|
||||
program and has the value resulting from parsing the content of
|
||||
the file named `bar`.
|
||||
|
||||
* `--exit-status` / `-e`:
|
||||
|
||||
Sets the exit status of jq to 0 if the last output value was
|
||||
neither `false` nor `null`, 1 if the last output value was
|
||||
either `false` or `null`, or 4 if no valid result was ever
|
||||
produced. Normally jq exits with 2 if there was any usage
|
||||
problem or system error, 3 if there was a jq program compile
|
||||
error, or 0 if the jq program ran.
|
||||
|
||||
* `--version` / `-V`:
|
||||
|
||||
Output the jq version and exit with zero.
|
||||
|
||||
* `--help` / `-h`:
|
||||
|
||||
Output the jq help and exit with zero.
|
||||
|
||||
- title: Basic filters
|
||||
entries:
|
||||
- title: "`.`"
|
||||
|
||||
Reference in new issue
Block a user