summaryrefslogtreecommitdiffstats
path: root/jq.1.prebuilt
diff options
context:
space:
mode:
authoritchyny <itchyny@cybozu.co.jp>2023-07-25 15:24:54 +0900
committerGitHub <noreply@github.com>2023-07-25 15:24:54 +0900
commit4705a22c7d8e9238161cbba9b6bad875155e28df (patch)
treeb1a27483b8ad39124d20f331e31a1a6cc0c65252 /jq.1.prebuilt
parent8f49600a6b717ada5973d518a9f042a4f2f8c58b (diff)
Reorder the command line options in the manual (#2766)
Diffstat (limited to 'jq.1.prebuilt')
-rw-r--r--jq.1.prebuilt116
1 files changed, 61 insertions, 55 deletions
diff --git a/jq.1.prebuilt b/jq.1.prebuilt
index e7d1a972..e7920df0 100644
--- a/jq.1.prebuilt
+++ b/jq.1.prebuilt
@@ -52,70 +52,58 @@ Windows command shell: \fBjq "\.[\e"foo\e"]"\fR
You can affect how jq reads and writes its input and output using some command\-line options:
.
.TP
-\fB\-\-version\fR/\fB\-V\fR:
+\fB\-\-null\-input\fR / \fB\-n\fR:
.
.IP
-Output the jq version and exit with zero\.
-.
-.TP
-\fB\-\-seq\fR:
-.
-.IP
-Use the \fBapplication/json\-seq\fR MIME type scheme for separating JSON texts in jq\'s input and output\. This means that an ASCII RS (record separator) character is printed before each value on output and an ASCII LF (line feed) is printed after every output\. Input JSON texts that fail to parse are ignored (but warned about), discarding all subsequent input until the next RS\. This mode also parses the output of jq without the \fB\-\-seq\fR option\.
+Don\'t read any input at all\. Instead, the filter is run once using \fBnull\fR as the input\. This is useful when using jq as a simple calculator or to construct JSON data from scratch\.
.
.TP
-\fB\-\-stream\fR:
-.
-.IP
-Parse the input in streaming fashion, outputting arrays of path and leaf values (scalars and empty arrays or empty objects)\. For example, \fB"a"\fR becomes \fB[[],"a"]\fR, and \fB[[],"a",["b"]]\fR becomes \fB[[0],[]]\fR, \fB[[1],"a"]\fR, and \fB[[2,0],"b"]\fR\.
+\fB\-\-raw\-input\fR / \fB\-R\fR:
.
.IP
-This is useful for processing very large inputs\. Use this in conjunction with filtering and the \fBreduce\fR and \fBforeach\fR syntax to reduce large inputs incrementally\.
+Don\'t parse the input as JSON\. Instead, each line of text is passed to the filter as a string\. If combined with \fB\-\-slurp\fR, then the entire input is passed to the filter as a single long string\.
.
.TP
-\fB\-\-stream\-errors\fR:
-.
-.IP
-Like \fB\-\-stream\fR, but invalid JSON inputs yield array values where the first element is the error and the second is a path\. For example, \fB["a",n]\fR produces ["Invalid literal at line 1, column 9",[1]]`\.
+\fB\-\-slurp\fR / \fB\-s\fR:
.
.IP
-Implies \fB\-\-stream\fR\. Invalid JSON inputs produce no error values when \fB\-\-stream\fR without \fB\-\-stream\-errors\fR\.
+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\.
.
.TP
-\fB\-\-slurp\fR/\fB\-s\fR:
+\fB\-\-compact\-output\fR / \fB\-c\fR:
.
.IP
-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\.
+By default, jq pretty\-prints JSON output\. Using this option will result in more compact output by instead putting each JSON object on a single line\.
.
.TP
-\fB\-\-raw\-input\fR/\fB\-R\fR:
+\fB\-\-raw\-output\fR / \fB\-r\fR:
.
.IP
-Don\'t parse the input as JSON\. Instead, each line of text is passed to the filter as a string\. If combined with \fB\-\-slurp\fR, then the entire input is passed to the filter as a single long string\.
+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\.
.
.TP
-\fB\-\-null\-input\fR/\fB\-n\fR:
+\fB\-\-join\-output\fR / \fB\-j\fR:
.
.IP
-Don\'t read any input at all! Instead, the filter is run once using \fBnull\fR as the input\. This is useful when using jq as a simple calculator or to construct JSON data from scratch\.
+Like \fB\-r\fR but jq won\'t print a newline after each output\.
.
.TP
-\fB\-\-compact\-output\fR / \fB\-c\fR:
+\fB\-\-nul\-output\fR / \fB\-0\fR:
.
.IP
-By default, jq pretty\-prints JSON output\. Using this option will result in more compact output by instead putting each JSON object on a single line\.
+Like \fB\-r\fR but jq will print NUL instead of newline after each output\. This can be useful when the values being output can contain newlines\.
.
.TP
-\fB\-\-tab\fR:
+\fB\-\-ascii\-output\fR / \fB\-a\fR:
.
.IP
-Use a tab for each indentation level instead of two spaces\.
+jq usually outputs non\-ASCII Unicode codepoints as UTF\-8, even if the input specified them as escape sequences (like "\eu03bc")\. Using this option, you can force jq to produce pure ASCII output with every non\-ASCII character replaced with the equivalent escape sequence\.
.
.TP
-\fB\-\-indent n\fR:
+\fB\-\-sort\-keys\fR / \fB\-S\fR:
.
.IP
-Use the given number of spaces (no more than 7) for indentation\.
+Output the fields of each object with the keys in sorted order\.
.
.TP
\fB\-\-color\-output\fR / \fB\-C\fR and \fB\-\-monochrome\-output\fR / \fB\-M\fR:
@@ -127,16 +115,16 @@ By default, jq outputs colored JSON if writing to a terminal\. You can force it
Colors can be configured with the \fBJQ_COLORS\fR environment variable (see below)\.
.
.TP
-\fB\-\-binary\fR / \fB\-b\fR:
+\fB\-\-tab\fR:
.
.IP
-Windows users using WSL, MSYS2, or Cygwin, should use this option when using a native jq\.exe, otherwise jq will turn newlines (LFs) into carriage\-return\-then\-newline (CRLF)\.
+Use a tab for each indentation level instead of two spaces\.
.
.TP
-\fB\-\-ascii\-output\fR / \fB\-a\fR:
+\fB\-\-indent n\fR:
.
.IP
-jq usually outputs non\-ASCII Unicode codepoints as UTF\-8, even if the input specified them as escape sequences (like "\eu03bc")\. Using this option, you can force jq to produce pure ASCII output with every non\-ASCII character replaced with the equivalent escape sequence\.
+Use the given number of spaces (no more than 7) for indentation\.
.
.TP
\fB\-\-unbuffered\fR:
@@ -145,28 +133,28 @@ jq usually outputs non\-ASCII Unicode codepoints as UTF\-8, even if the input sp
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)\.
.
.TP
-\fB\-\-sort\-keys\fR / \fB\-S\fR:
+\fB\-\-stream\fR:
.
.IP
-Output the fields of each object with the keys in sorted order\.
-.
-.TP
-\fB\-\-raw\-output\fR / \fB\-r\fR:
+Parse the input in streaming fashion, outputting arrays of path and leaf values (scalars and empty arrays or empty objects)\. For example, \fB"a"\fR becomes \fB[[],"a"]\fR, and \fB[[],"a",["b"]]\fR becomes \fB[[0],[]]\fR, \fB[[1],"a"]\fR, and \fB[[2,0],"b"]\fR\.
.
.IP
-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\.
+This is useful for processing very large inputs\. Use this in conjunction with filtering and the \fBreduce\fR and \fBforeach\fR syntax to reduce large inputs incrementally\.
.
.TP
-\fB\-\-join\-output\fR / \fB\-j\fR:
+\fB\-\-stream\-errors\fR:
.
.IP
-Like \fB\-r\fR but jq won\'t print a newline after each output\.
+Like \fB\-\-stream\fR, but invalid JSON inputs yield array values where the first element is the error and the second is a path\. For example, \fB["a",n]\fR produces \fB["Invalid literal at line 1, column 7",[1]]\fR\.
+.
+.IP
+Implies \fB\-\-stream\fR\. Invalid JSON inputs produce no error values when \fB\-\-stream\fR without \fB\-\-stream\-errors\fR\.
.
.TP
-\fB\-\-nul\-output\fR / \fB\-0\fR:
+\fB\-\-seq\fR:
.
.IP
-Like \fB\-r\fR but jq will print NUL instead of newline after each output\. This can be useful when the values being output can contain newlines\.
+Use the \fBapplication/json\-seq\fR MIME type scheme for separating JSON texts in jq\'s input and output\. This means that an ASCII RS (record separator) character is printed before each value on output and an ASCII LF (line feed) is printed after every output\. Input JSON texts that fail to parse are ignored (but warned about), discarding all subsequent input until the next RS\. This mode also parses the output of jq without the \fB\-\-seq\fR option\.
.
.TP
\fB\-f filename\fR / \fB\-\-from\-file filename\fR:
@@ -175,21 +163,12 @@ Like \fB\-r\fR but jq will print NUL instead of newline after each output\. This
Read filter from the file rather than from a command line, like awk\'s \-f option\. You can also use \'#\' to make comments\.
.
.TP
-\fB\-Ldirectory\fR / \fB\-L directory\fR:
+\fB\-L directory\fR:
.
.IP
Prepend \fBdirectory\fR to the search list for modules\. If this option is used then no builtin search list is used\. See the section on modules below\.
.
.TP
-\fB\-e\fR / \fB\-\-exit\-status\fR:
-.
-.IP
-Sets the exit status of jq to 0 if the last output value was neither \fBfalse\fR nor \fBnull\fR, 1 if the last output value was either \fBfalse\fR or \fBnull\fR, 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\.
-.
-.IP
-Another way to set the exit status is with the \fBhalt_error\fR builtin function\.
-.
-.TP
\fB\-\-arg name value\fR:
.
.IP
@@ -238,6 +217,33 @@ Remaining arguments are positional string arguments\. These are available to the
Remaining arguments are positional JSON text arguments\. These are available to the jq program as \fB$ARGS\.positional[]\fR\.
.
.TP
+\fB\-\-exit\-status\fR / \fB\-e\fR:
+.
+.IP
+Sets the exit status of jq to 0 if the last output value was neither \fBfalse\fR nor \fBnull\fR, 1 if the last output value was either \fBfalse\fR or \fBnull\fR, 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\.
+.
+.IP
+Another way to set the exit status is with the \fBhalt_error\fR builtin function\.
+.
+.TP
+\fB\-\-binary\fR / \fB\-b\fR:
+.
+.IP
+Windows users using WSL, MSYS2, or Cygwin, should use this option when using a native jq\.exe, otherwise jq will turn newlines (LFs) into carriage\-return\-then\-newline (CRLF)\.
+.
+.TP
+\fB\-\-version\fR / \fB\-V\fR:
+.
+.IP
+Output the jq version and exit with zero\.
+.
+.TP
+\fB\-\-help\fR / \fB\-h\fR:
+.
+.IP
+Output the jq help and exit with zero\.
+.
+.TP
\fB\-\-\fR:
.
.IP
@@ -247,7 +253,7 @@ Terminates argument processing\. Remaining arguments are positional, either stri
\fB\-\-run\-tests [filename]\fR:
.
.IP
-Runs the tests in the given file or standard input\. This must be the last option given and does not honor all preceding options\. The input consists of comment lines, empty lines, and program lines followed by one input line, as many lines of output as are expected (one per output), and a terminating empty line\. Compilation failure tests start with a line containing only "%%FAIL", then a line containing the program to compile, then a line containing an error message to compare to the actual\.
+Runs the tests in the given file or standard input\. This must be the last option given and does not honor all preceding options\. The input consists of comment lines, empty lines, and program lines followed by one input line, as many lines of output as are expected (one per output), and a terminating empty line\. Compilation failure tests start with a line containing only \fB%%FAIL\fR, then a line containing the program to compile, then a line containing an error message to compare to the actual\.
.
.IP
Be warned that this option can change backwards\-incompatibly\.