summaryrefslogtreecommitdiffstats
path: root/jq.1.prebuilt
diff options
context:
space:
mode:
authorNicolas Williams <nico@cryptonector.com>2023-07-29 13:44:14 -0500
committerNico Williams <nico@cryptonector.com>2023-08-01 23:06:01 -0500
commit27a4d5757e42d9653585eeddda78e8d313bad194 (patch)
tree6ab7361f58b7316d1546b1d344e6f035015b2afb /jq.1.prebuilt
parent044b38595cc2d6670fed510ecba9df87f6b39e1b (diff)
Require a main program (fix #2785)
Diffstat (limited to 'jq.1.prebuilt')
-rw-r--r--jq.1.prebuilt8
1 files changed, 7 insertions, 1 deletions
diff --git a/jq.1.prebuilt b/jq.1.prebuilt
index de3dfa34..5166c79b 100644
--- a/jq.1.prebuilt
+++ b/jq.1.prebuilt
@@ -35,7 +35,10 @@ But that\'s getting ahead of ourselves\. :) Let\'s start with something simpler:
jq filters run on a stream of JSON data\. The input to jq is parsed as a sequence of whitespace\-separated JSON values which are passed through the provided filter one at a time\. The output(s) of the filter are written to standard output, as a sequence of newline\-separated JSON data\.
.
.P
-Note: it is important to mind the shell\'s quoting rules\. As a general rule it\'s best to always quote (with single\-quote characters) the jq program, as too many characters with special meaning to jq are also shell meta\-characters\. For example, \fBjq "foo"\fR will fail on most Unix shells because that will be the same as \fBjq foo\fR, which will generally fail because \fBfoo is not defined\fR\. When using the Windows command shell (cmd\.exe) it\'s best to use double quotes around your jq program when given on the command\-line (instead of the \fB\-f program\-file\fR option), but then double\-quotes in the jq program need backslash escaping\. When using the Powershell (\fBpowershell\.exe\fR) or the Powershell Core (\fBpwsh\fR/\fBpwsh\.exe\fR), use single\-quote characters around the jq program and backslash\-escaped double\-quotes (\fB\e"\fR) inside the jq program\.
+The simplest and most common filter (or jq program) is \fB\.\fR, which is the identity operator, copying the inputs of the jq processor to the output stream\. Because the default behavior of the jq processor is to read JSON texts from the input stream, and to pretty\-print outputs, the \fB\.\fR program\'s main use is to validate and pretty\-print the inputs\. The jq programming language is quite rich and allows for much more than just validation and pretty\-printing\.
+.
+.P
+Note: it is important to mind the shell\'s quoting rules\. As a general rule it\'s best to always quote (with single\-quote characters on Unix shells) the jq program, as too many characters with special meaning to jq are also shell meta\-characters\. For example, \fBjq "foo"\fR will fail on most Unix shells because that will be the same as \fBjq foo\fR, which will generally fail because \fBfoo is not defined\fR\. When using the Windows command shell (cmd\.exe) it\'s best to use double quotes around your jq program when given on the command\-line (instead of the \fB\-f program\-file\fR option), but then double\-quotes in the jq program need backslash escaping\. When using the Powershell (\fBpowershell\.exe\fR) or the Powershell Core (\fBpwsh\fR/\fBpwsh\.exe\fR), use single\-quote characters around the jq program and backslash\-escaped double\-quotes (\fB\e"\fR) inside the jq program\.
.
.IP "\(bu" 4
Unix shells: \fBjq \'\.["foo"]\'\fR
@@ -49,6 +52,9 @@ Windows command shell: \fBjq "\.[\e"foo\e"]"\fR
.IP "" 0
.
.P
+Note: jq allows user\-defined functions, but every jq program must have a top\-level expression\.
+.
+.P
You can affect how jq reads and writes its input and output using some command\-line options:
.
.TP