summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Langford <wlangfor@gmail.com>2018-11-01 22:07:54 -0400
committerWilliam Langford <wlangfor@gmail.com>2018-11-01 22:07:54 -0400
commit57c6b85ab90e49a0357085f65e644731cd92b9bc (patch)
treef5b6341cdf3fea47dda13c6cff9b94ba8657ea43
parente9cccbdd288a2e8ece52e4d0c419d11c60a4db3a (diff)
Pick up jq-1.6
-rw-r--r--download/index.html26
-rw-r--r--index.html7
-rw-r--r--index/index.html7
-rw-r--r--manual/index.html287
-rw-r--r--manual/v1.6/index.html7532
-rw-r--r--sitemap.xml19
6 files changed, 7828 insertions, 50 deletions
diff --git a/download/index.html b/download/index.html
index c44d1238..634d8eb5 100644
--- a/download/index.html
+++ b/download/index.html
@@ -89,6 +89,10 @@
</li>
<li>
+<p>jq 1.6 binaries for <a href="https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64">64-bit</a> or <a href="https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux32">32-bit</a>.</p>
+</li>
+
+<li>
<p>jq 1.5 binaries for <a href="https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64">64-bit</a> or <a href="https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux32">32-bit</a>.</p>
</li>
@@ -109,6 +113,10 @@
</li>
<li>
+<p>jq 1.6 binary for <a href="https://github.com/stedolan/jq/releases/download/jq-1.6/jq-osx-amd64">64-bit</a>.</p>
+</li>
+
+<li>
<p>jq 1.5 binary for <a href="https://github.com/stedolan/jq/releases/download/jq-1.5/jq-osx-amd64">64-bit</a>.</p>
</li>
@@ -124,7 +132,13 @@
<h3 id="freebsd">FreeBSD</h3>
<ul>
-<li>Use <a href="https://www.freshports.org/textproc/jq/">FreshPorts</a> to install jq 1.4 with <code>pkg install jq</code>.</li>
+<li>
+<p><code>pkg install jq</code> as root installs a pre-built <a href="https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/pkgng-intro.html">binary package</a>.</p>
+</li>
+
+<li>
+<p><code>make -C /usr/ports/textproc/jq install clean</code> as root installs the <a href="https://www.freshports.org/textproc/jq/">jq</a> <a href="https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html">port</a> from source.</p>
+</li>
</ul>
<h3 id="solaris">Solaris</h3>
@@ -147,6 +161,10 @@
</li>
<li>
+<p>jq 1.6 executables for <a href="https://github.com/stedolan/jq/releases/download/jq-1.6/jq-win64.exe">64-bit</a> or <a href="https://github.com/stedolan/jq/releases/download/jq-1.6/jq-win32.exe">32-bit</a>.</p>
+</li>
+
+<li>
<p>jq 1.5 executables for <a href="https://github.com/stedolan/jq/releases/download/jq-1.5/jq-win64.exe">64-bit</a> or <a href="https://github.com/stedolan/jq/releases/download/jq-1.5/jq-win32.exe">32-bit</a>.</p>
</li>
@@ -161,13 +179,15 @@
<h3 id="checksums_and_signatures">Checksums and signatures</h3>
-<p>SHA-256 checksums are provided for all release and pre-release binaries. They can be found under <a href="https://github.com/stedolan/jq/tree/master/sig">sig/v1.x/sha256sum.txt</a>. The checksums for jq 1.5 are in <a href="https://raw.githubusercontent.com/stedolan/jq/master/sig/v1.5/sha256sum.txt">sig/v1.5/sha256sum.txt</a>.</p>
+<p>SHA-256 checksums are provided for all release and pre-release binaries. They can be found under <a href="https://github.com/stedolan/jq/tree/master/sig">sig/v1.x/sha256sum.txt</a>. The checksums for jq 1.6 are in <a href="https://raw.githubusercontent.com/stedolan/jq/master/sig/v1.6/sha256sum.txt">sig/v1.6/sha256sum.txt</a>. The checksums for jq 1.5 are in <a href="https://raw.githubusercontent.com/stedolan/jq/master/sig/v1.5/sha256sum.txt">sig/v1.5/sha256sum.txt</a>.</p>
-<p>Additionally, all binaries are signed by the <a href="https://raw.githubusercontent.com/stedolan/jq/master/sig/jq-release.key">jq Package Signing Key</a>. The signatures can be found under <a href="https://github.com/stedolan/jq/tree/master/sig">sig/v1.x/*.asc</a>. The signatures for jq 1.5 are in <a href="https://github.com/stedolan/jq/tree/master/sig/v1.5">sig/v1.5/*.asc</a>. You can use <a href="https://gnupg.org/">GnuPG</a> to verify a signature by downloading the signature and running <code>gpg --verify signature.asc</code>.</p>
+<p>Additionally, all binaries are signed by the <a href="https://raw.githubusercontent.com/stedolan/jq/master/sig/jq-release.key">jq Package Signing Key</a>. The signatures can be found under <a href="https://github.com/stedolan/jq/tree/master/sig">sig/v1.x/*.asc</a>. The signatures for jq 1.6 are in <a href="https://github.com/stedolan/jq/tree/master/sig/v1.6">sig/v1.5/*.asc</a>. The signatures for jq 1.5 are in <a href="https://github.com/stedolan/jq/tree/master/sig/v1.5">sig/v1.5/*.asc</a>. You can use <a href="https://gnupg.org/">GnuPG</a> to verify a signature by downloading the signature and running <code>gpg --verify signature.asc</code>.</p>
<h3 id="from_source_on_linux_os_x_cygwin_and_other_posixlike_operating_systems">From source on Linux, OS X, Cygwin, and other POSIX-like operating systems</h3>
<ul>
+<li><a href="https://github.com/stedolan/jq/releases/download/jq-1.6/jq-1.6.tar.gz">Source tarball for jq 1.6</a></li>
+
<li><a href="https://github.com/stedolan/jq/releases/download/jq-1.5/jq-1.5.tar.gz">Source tarball for jq 1.5</a></li>
</ul>
diff --git a/index.html b/index.html
index 615fd2bf..12c9e247 100644
--- a/index.html
+++ b/index.html
@@ -121,6 +121,13 @@ tag</a>, or on the
<ul>
<li>
+ <span class="date">1 November 2018</span>
+
+<p>jq 1.6 released. See installation options on the <a href="/jq/download/">download</a> page, and the <a href="https://github.com/stedolan/jq/releases/tag/jq-1.6">release notes</a> for details.</p>
+
+ </li>
+
+ <li>
<span class="date">15 August 2015</span>
<p>jq 1.5 released, including new datetime, math, and regexp functions, try/catch syntax, array and object destructuring, a streaming parser, and a module system. See installation options on the <a href="/jq/download/">download</a> page, and the <a href="https://github.com/stedolan/jq/releases/tag/jq-1.5">release notes</a> for details.</p>
diff --git a/index/index.html b/index/index.html
index 615fd2bf..12c9e247 100644
--- a/index/index.html
+++ b/index/index.html
@@ -121,6 +121,13 @@ tag</a>, or on the
<ul>
<li>
+ <span class="date">1 November 2018</span>
+
+<p>jq 1.6 released. See installation options on the <a href="/jq/download/">download</a> page, and the <a href="https://github.com/stedolan/jq/releases/tag/jq-1.6">release notes</a> for details.</p>
+
+ </li>
+
+ <li>
<span class="date">15 August 2015</span>
<p>jq 1.5 released, including new datetime, math, and regexp functions, try/catch syntax, array and object destructuring, a streaming parser, and a module system. See installation options on the <a href="/jq/download/">download</a> page, and the <a href="https://github.com/stedolan/jq/releases/tag/jq-1.5">release notes</a> for details.</p>
diff --git a/manual/index.html b/manual/index.html
index b3de11b1..f1abd39f 100644
--- a/manual/index.html
+++ b/manual/index.html
@@ -111,6 +111,10 @@
<a href="#Modules">Modules</a>
</li>
+ <li>
+ <a href="#Colors">Colors</a>
+ </li>
+
</ul>
<form class="form-group" onsubmit="go_to_section(); return false;">
<input type="text"
@@ -123,8 +127,9 @@
<div id="manualcontent">
<h1>jq Manual (development version)</h1>
- <p><em>For released versions, see <a href='/jq/manual/v1.5'>jq 1.5</a>,
-<a href='/jq/manual/v1.4'>jq 1.4</a> or <a href='/jq/manual/v1.3'>jq 1.3</a>.</em></p>
+ <p><em>For released versions, see <a href='/jq/manual/v1.6'>jq 1.6</a>,
+<a href='/jq/manual/v1.5'>jq 1.5</a>, <a href='/jq/manual/v1.4'>jq 1.4</a>
+or <a href='/jq/manual/v1.3'>jq 1.3</a>.</em></p>
<p>A jq program is a &ldquo;filter&rdquo;: it takes an input, and produces an
output. There are a lot of builtin filters for extracting a
particular field of an object, or converting a number to a string,
@@ -215,6 +220,8 @@ defined</code>. When using the Windows command shell (cmd.exe) it’s best to us
<p><code>--color-output</code> / <code>-C</code> and <code>--monochrome-output</code> / <code>-M</code>:</p>
<p>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 <code>-C</code>, and disable color with <code>-M</code>.</p>
+
+<p>Colors can be configured with the <code>JQ_COLORS</code> environment variable (see below).</p>
</li>
<li>
@@ -284,7 +291,13 @@ defined</code>. When using the Windows command shell (cmd.exe) it’s best to us
<li>
<p><code>--slurpfile variable-name filename</code>:</p>
-<p>This option reads all the JSON texts in the named file and binds an array of the parsed JSON values to the given global variable. If you run jq with <code>--argfile foo bar</code>, then <code>$foo</code> is available in the program and has an array whose elements correspond to the texts in the file named <code>bar</code>.</p>
+<p>This option reads all the JSON texts in the named file and binds an array of the parsed JSON values to the given global variable. If you run jq with <code>--slurpfile foo bar</code>, then <code>$foo</code> is available in the program and has an array whose elements correspond to the texts in the file named <code>bar</code>.</p>
+</li>
+
+<li>
+<p><code>--rawfile variable-name filename</code>:</p>
+
+<p>This option reads in the named file and binds its contents to the given global variable. If you run jq with <code>--rawfile foo bar</code>, then <code>$foo</code> is available in the program and has a string whose contents are to the texs in the file named <code>bar</code>.</p>
</li>
<li>
@@ -4875,7 +4888,7 @@ Dates
<p>Low-level jq interfaces to the C-library time functions are also provided: <code>strptime</code>, <code>strftime</code>, <code>strflocaltime</code>, <code>mktime</code>, <code>gmtime</code>, and <code>localtime</code>. Refer to your host operating system’s documentation for the format strings used by <code>strptime</code> and <code>strftime</code>. Note: these are not necessarily stable interfaces in jq, particularly as to their localization functionality.</p>
-<p>The <code>gmtime</code> builtin consumes a number of seconds since the Unix epoch and outputs a “broken down time” representation of Greenwhich Meridian time as an array of numbers representing (in this order): the year, the month (zero-based), the day of the month, the hour of the day, the minute of the hour, the second of the minute, the day of the week, and the day of the year – all one-based unless otherwise stated.</p>
+<p>The <code>gmtime</code> builtin consumes a number of seconds since the Unix epoch and outputs a “broken down time” representation of Greenwhich Meridian time as an array of numbers representing (in this order): the year, the month (zero-based), the day of the month (one-based), the hour of the day, the minute of the hour, the second of the minute, the day of the week, and the day of the year – all one-based unless otherwise stated. The day of the week number may be wrong on some systems for dates before March 1st 1900, or after December 31 2099.</p>
<p>The <code>localtime</code> builtin works like the <code>gmtime</code> builtin, but using the local timezone setting.</p>
@@ -4887,7 +4900,7 @@ Dates
<p>The format strings for <code>strptime</code> and <code>strftime</code> are described in typical C library documentation. The format string for ISO 8601 datetime is <code>&quot;%Y-%m-%dT%H:%M:%SZ&quot;</code>.</p>
-<p>jq may not support some or all of this date functionality on some systems.</p>
+<p>jq may not support some or all of this date functionality on some systems. In particular, the <code>%u</code> and <code>%j</code> specifiers for <code>strptime(fmt)</code> are not supported on macOS.</p>
@@ -5452,10 +5465,10 @@ try repeat(exp) catch .==&quot;break&quot; then empty else error;</code></pre>
</section>
- <section id="ErrorSuppresion/OptionalOperator:?">
+ <section id="ErrorSuppression/OptionalOperator:?">
<h3>
-Error Suppresion / Optional Operator: <code>?</code>
+Error Suppression / Optional Operator: <code>?</code>
</h3>
@@ -6021,6 +6034,108 @@ Variable / Symbolic Binding Operator: <code>... as $identifier | ...</code>
</section>
+ <section id="DestructuringAlternativeOperator:?//">
+ <h3>
+
+Destructuring Alternative Operator: <code>?//</code>
+
+
+ </h3>
+
+<p>The destructuring alternative operator provides a concise mechanism for destructuring an input that can take one of several forms.</p>
+
+<p>Suppose we have an API that returns a list of resources and events associated with them, and we want to get the user_id and timestamp of the first event for each resource. The API (having been clumsily converted from XML) will only wrap the events in an array if the resource has multiple events:</p>
+
+<pre><code>{&quot;resources&quot;: [{&quot;id&quot;: 1, &quot;kind&quot;: &quot;widget&quot;, &quot;events&quot;: {&quot;action&quot;: &quot;create&quot;, &quot;user_id&quot;: 1, &quot;ts&quot;: 13}},
+ {&quot;id&quot;: 2, &quot;kind&quot;: &quot;widget&quot;, &quot;events&quot;: [{&quot;action&quot;: &quot;create&quot;, &quot;user_id&quot;: 1, &quot;ts&quot;: 14}, {&quot;action&quot;: &quot;destroy&quot;, &quot;user_id&quot;: 1, &quot;ts&quot;: 15}]}]}</code></pre>
+
+<p>We can use the destructuring alternative operator to handle this structural change simply:</p>
+
+<pre><code>.resources[] as {$id, $kind, events: {$user_id, $ts}} ?// {$id, $kind, events: [{$user_id, $ts}]} | {$user_id, $kind, $id, $ts}</code></pre>
+
+<p>Or, if we aren’t sure if the input is an array of values or an object:</p>
+
+<pre><code>.[] as [$id, $kind, $user_id, $ts] ?// {$id, $kind, $user_id, $ts} | ...</code></pre>
+
+<p>Each alternative need not define all of the same variables, but all named variables will be available to the subsequent expression. Variables not matched in the alternative that succeeded will be <code>null</code>:</p>
+
+<pre><code>.resources[] as {$id, $kind, events: {$user_id, $ts}} ?// {$id, $kind, events: [{$first_user_id, $first_ts}]} | {$user_id, $first_user_id, $kind, $id, $ts, $first_ts}</code></pre>
+
+<p>Additionally, if the subsequent expression returns an error, the alternative operator will attempt to try the next binding. Errors that occur during the final alternative are passed through.</p>
+
+<pre><code>[[3]] | .[] as [$a] ?// [$b] | if $a != null then error(&quot;err: \($a)&quot;) else {$a,$b} end</code></pre>
+
+
+
+ <div>
+
+ <a data-toggle="collapse" href="#example84">
+ <i class="glyphicon glyphicon-chevron-right"></i>
+ Examples
+ </a>
+ <div id="example84" class="manual-example collapse">
+
+ <table>
+ <tr><th></th><td class="jqprogram">jq '.[] as {$a, $b, c: {$d, $e}} ?// {$a, $b, c: [{$d, $e}]} | {$a, $b, $d, $e}'</td></tr>
+ <tr><th>Input</th><td>[{&quot;a&quot;: 1, &quot;b&quot;: 2, &quot;c&quot;: {&quot;d&quot;: 3, &quot;e&quot;: 4}}, {&quot;a&quot;: 1, &quot;b&quot;: 2, &quot;c&quot;: [{&quot;d&quot;: 3, &quot;e&quot;: 4}]}]</td></tr>
+
+
+ <tr>
+
+ <th>Output</th>
+
+ <td>{&quot;a&quot;:1,&quot;b&quot;:2,&quot;d&quot;:3,&quot;e&quot;:4}</td>
+ </tr>
+
+ <tr>
+
+ <th></th>
+
+ <td>{&quot;a&quot;:1,&quot;b&quot;:2,&quot;d&quot;:3,&quot;e&quot;:4}</td>
+ </tr>
+
+ </table>
+
+ <table>
+ <tr><th></th><td class="jqprogram">jq '.[] as {$a, $b, c: {$d}} ?// {$a, $b, c: [{$e}]} | {$a, $b, $d, $e}'</td></tr>
+ <tr><th>Input</th><td>[{&quot;a&quot;: 1, &quot;b&quot;: 2, &quot;c&quot;: {&quot;d&quot;: 3, &quot;e&quot;: 4}}, {&quot;a&quot;: 1, &quot;b&quot;: 2, &quot;c&quot;: [{&quot;d&quot;: 3, &quot;e&quot;: 4}]}]</td></tr>
+
+
+ <tr>
+
+ <th>Output</th>
+
+ <td>{&quot;a&quot;:1,&quot;b&quot;:2,&quot;d&quot;:3,&quot;e&quot;:null}</td>
+ </tr>
+
+ <tr>
+
+ <th></th>
+
+ <td>{&quot;a&quot;:1,&quot;b&quot;:2,&quot;d&quot;:null,&quot;e&quot;:4}</td>
+ </tr>
+
+ </table>
+
+ <table>
+ <tr><th></th><td class="jqprogram">jq '.[] as [$a] ?// [$b] | if $a != null then error(&quot;err: \($a)&quot;) else {$a,$b} end'</td></tr>
+ <tr><th>Input</th><td>[[3]]</td></tr>
+
+
+ <tr>
+
+ <th>Output</th>
+
+ <td>{&quot;a&quot;:null,&quot;b&quot;:3}</td>
+ </tr>
+
+ </table>
+
+ </div>
+ </div>
+
+ </section>
+
<section id="DefiningFunctions">
<h3>
@@ -6060,11 +6175,11 @@ Defining Functions
<div>
- <a data-toggle="collapse" href="#example84">
+ <a data-toggle="collapse" href="#example85">
<i class="glyphicon glyphicon-chevron-right"></i>
Examples
</a>
- <div id="example84" class="manual-example collapse">
+ <div id="example85" class="manual-example collapse">
<table>
<tr><th></th><td class="jqprogram">jq 'def addvalue(f): . + [f]; map(addvalue(.[0]))'</td></tr>
@@ -6135,18 +6250,15 @@ Reduce
(2 as $item | . + $item) |
(1 as $item | . + $item)</code></pre>
-<p>If the reduction update expression outputs <code>empty</code> (that is, no values), then the reduction state is left as-is. For example, <code>reduce range(4) as $n ({}; if .==2 then empty else
-.[$n|tostring] |= $n)</code> will produce <code>{&quot;0&quot;:0,&quot;1&quot;:1,&quot;3&quot;:3}</code>.</p>
-
<div>
- <a data-toggle="collapse" href="#example85">
+ <a data-toggle="collapse" href="#example86">
<i class="glyphicon glyphicon-chevron-right"></i>
- Examples
+ Example
</a>
- <div id="example85" class="manual-example collapse">
+ <div id="example86" class="manual-example collapse">
<table>
<tr><th></th><td class="jqprogram">jq 'reduce .[] as $item (0; . + $item)'</td></tr>
@@ -6162,16 +6274,41 @@ Reduce
</table>
+ </div>
+ </div>
+
+ </section>
+
+ <section id="isempty(exp)">
+ <h3>
+
+<code>isempty(exp)</code>
+
+
+ </h3>
+
+<p>Returns true if <code>exp</code> produces no outputs, false otherwise.</p>
+
+
+
+ <div>
+
+ <a data-toggle="collapse" href="#example87">
+ <i class="glyphicon glyphicon-chevron-right"></i>
+ Example
+ </a>
+ <div id="example87" class="manual-example collapse">
+
<table>
- <tr><th></th><td class="jqprogram">jq 'reduce .[] as $n ([]; if $n%2==0 then empty else . + [$n] end)'</td></tr>
- <tr><th>Input</th><td>[0,1,2,3,4,5]</td></tr>
+ <tr><th></th><td class="jqprogram">jq 'isempty(empty)'</td></tr>
+ <tr><th>Input</th><td>null</td></tr>
<tr>
<th>Output</th>
- <td>[1,3,5]</td>
+ <td>true</td>
</tr>
</table>
@@ -6195,11 +6332,11 @@ Reduce
<div>
- <a data-toggle="collapse" href="#example86">
+ <a data-toggle="collapse" href="#example88">
<i class="glyphicon glyphicon-chevron-right"></i>
Example
</a>
- <div id="example86" class="manual-example collapse">
+ <div id="example88" class="manual-example collapse">
<table>
<tr><th></th><td class="jqprogram">jq '[limit(3;.[])]'</td></tr>
@@ -6237,11 +6374,11 @@ last(limit(n + 1; expr));</code>. Note that <code>nth(n; expr)</code> doesn’t
<div>
- <a data-toggle="collapse" href="#example87">
+ <a data-toggle="collapse" href="#example89">
<i class="glyphicon glyphicon-chevron-right"></i>
Example
</a>
- <div id="example87" class="manual-example collapse">
+ <div id="example89" class="manual-example collapse">
<table>
<tr><th></th><td class="jqprogram">jq '[first(range(.)), last(range(.)), nth(./2; range(.))]'</td></tr>
@@ -6278,11 +6415,11 @@ last(limit(n + 1; expr));</code>. Note that <code>nth(n; expr)</code> doesn’t
<div>
- <a data-toggle="collapse" href="#example88">
+ <a data-toggle="collapse" href="#example90">
<i class="glyphicon glyphicon-chevron-right"></i>
Example
</a>
- <div id="example88" class="manual-example collapse">
+ <div id="example90" class="manual-example collapse">
<table>
<tr><th></th><td class="jqprogram">jq '[range(.)]|[first, last, nth(5)]'</td></tr>
@@ -6321,11 +6458,11 @@ last(limit(n + 1; expr));</code>. Note that <code>nth(n; expr)</code> doesn’t
<div>
- <a data-toggle="collapse" href="#example89">
+ <a data-toggle="collapse" href="#example91">
<i class="glyphicon glyphicon-chevron-right"></i>
Example
</a>
- <div id="example89" class="manual-example collapse">
+ <div id="example91" class="manual-example collapse">
<table>
<tr><th></th><td class="jqprogram">jq '[foreach .[] as $item ([[],[]]; if $item == null then [[],.[0]] else [(.[0] + [$item]),[]] end; if $item == null then .[1] else empty end)]'</td></tr>
@@ -6396,11 +6533,11 @@ Generators and iterators
<div>
- <a data-toggle="collapse" href="#example90">
+ <a data-toggle="collapse" href="#example92">
<i class="glyphicon glyphicon-chevron-right"></i>
Examples
</a>
- <div id="example90" class="manual-example collapse">
+ <div id="example92" class="manual-example collapse">
<table>
<tr><th></th><td class="jqprogram">jq 'def range(init; upto; by): def _range: if (by &gt; 0 and . &lt; upto) or (by &lt; 0 and . &gt; upto) then ., ((.+by)|_range) else . end; if by == 0 then init else init|_range end | select((by &gt; 0 and . &lt; upto) or (by &lt; 0 and . &gt; upto)); range(0; 10; 3)'</td></tr>
@@ -6604,11 +6741,11 @@ Generators and iterators
<div>
- <a data-toggle="collapse" href="#example91">
+ <a data-toggle="collapse" href="#example93">
<i class="glyphicon glyphicon-chevron-right"></i>
Example
</a>
- <div id="example91" class="manual-example collapse">
+ <div id="example93" class="manual-example collapse">
<table>
<tr><th></th><td class="jqprogram">jq '[1|truncate_stream([[0],1],[[1,0],2],[[1,0]],[[1]])]'</td></tr>
@@ -6643,11 +6780,11 @@ Generators and iterators
<div>
- <a data-toggle="collapse" href="#example92">
+ <a data-toggle="collapse" href="#example94">
<i class="glyphicon glyphicon-chevron-right"></i>
Example
</a>
- <div id="example92" class="manual-example collapse">
+ <div id="example94" class="manual-example collapse">
<table>
<tr><th></th><td class="jqprogram">jq 'fromstream(1|truncate_stream([[0],1],[[1,0],2],[[1,0]],[[1]]))'</td></tr>
@@ -6682,11 +6819,11 @@ Generators and iterators
<div>
- <a data-toggle="collapse" href="#example93">
+ <a data-toggle="collapse" href="#example95">
<i class="glyphicon glyphicon-chevron-right"></i>
Example
</a>
- <div id="example93" class="manual-example collapse">
+ <div id="example95" class="manual-example collapse">
<table>
<tr><th></th><td class="jqprogram">jq '. as $dot|fromstream($dot|tostream)|.==$dot'</td></tr>
@@ -6718,7 +6855,7 @@ Generators and iterators
<p>This means that it’s impossible to build circular values in jq (such as an array whose first element is itself). This is quite intentional, and ensures that anything a jq program can produce can be represented in JSON.</p>
-<p>All the assignment operators in jq have path expressions on the left-hand side (LHS). The right-hand side (RHS) procides values to set to the paths named by the LHS path expressions.</p>
+<p>All the assignment operators in jq have path expressions on the left-hand side (LHS). The right-hand side (RHS) provides values to set to the paths named by the LHS path expressions.</p>
<p>Values in jq are always immutable. Internally, assignment works by using a reduction to compute new, replacement values for <code>.</code> that have had all the desired assignments applied to <code>.</code>, then outputting the modified value. This might be made clear by this example: <code>{a:{b:{c:1}}} | (.a.b|=3), .</code>. This will output <code>{&quot;a&quot;:{&quot;b&quot;:3}}</code> and <code>{&quot;a&quot;:{&quot;b&quot;:{&quot;c&quot;:1}}}</code> because the last sub-expression, <code>.</code>, sees the original value, not the modified value.</p>
@@ -6753,11 +6890,11 @@ Update-assignment: <code>|=</code>
<div>
- <a data-toggle="collapse" href="#example94">
+ <a data-toggle="collapse" href="#example96">
<i class="glyphicon glyphicon-chevron-right"></i>
Example
</a>
- <div id="example94" class="manual-example collapse">
+ <div id="example96" class="manual-example collapse">
<table>
<tr><th></th><td class="jqprogram">jq '(..|select(type==&quot;boolean&quot;)) |= if . then 1 else 0 end'</td></tr>
@@ -6792,11 +6929,11 @@ Arithmetic update-assignment: <code>+=</code>, <code>-=</code>, <code>*=</code>,
<div>
- <a data-toggle="collapse" href="#example95">
+ <a data-toggle="collapse" href="#example97">
<i class="glyphicon glyphicon-chevron-right"></i>
Example
</a>
- <div id="example95" class="manual-example collapse">
+ <div id="example97" class="manual-example collapse">
<table>
<tr><th></th><td class="jqprogram">jq '.foo += 1'</td></tr>
@@ -7005,6 +7142,68 @@ Complex assignments
</section>
+ <section id="Colors">
+ <h2>Colors</h2>
+
+<p>To configure alternative colors just set the <code>JQ_COLORS</code> environment variable to colon-delimited list of partial terminal escape sequences like <code>&quot;1;31&quot;</code>, in this order:</p>
+
+<ul>
+<li>color for <code>null</code></li>
+
+<li>color for <code>false</code></li>
+
+<li>color for <code>true</code></li>
+
+<li>color for numbers</li>
+
+<li>color for strings</li>
+
+<li>color for arrays</li>
+
+<li>color for objects</li>
+</ul>
+
+<p>The default color scheme is the same as setting <code>&quot;JQ_COLORS=1;30:0;39:0;39:0;39:0;32:1;39:1;39&quot;</code>.</p>
+
+<p>This is not a manual for VT100/ANSI escapes. However, each of these color specifications should consist of two numbers separated by a semi-colon, where the first number is one of these:</p>
+
+<ul>
+<li>1 (bright)</li>
+
+<li>2 (dim)</li>
+
+<li>4 (underscore)</li>
+
+<li>5 (blink)</li>
+
+<li>7 (reverse)</li>
+
+<li>8 (hidden)</li>
+</ul>
+
+<p>and the second is one of these:</p>
+
+<ul>
+<li>30 (black)</li>
+
+<li>31 (red)</li>
+
+<li>32 (green)</li>
+
+<li>33 (yellow)</li>
+
+<li>34 (blue)</li>
+
+<li>35 (magenta)</li>
+
+<li>36 (cyan)</li>
+
+<li>37 (white)</li>
+</ul>
+
+
+ </section>
+
</div>
</div>
</div>
@@ -7214,7 +7413,7 @@ Complex assignments
"Breaking out of control structures" : "Breakingoutofcontrolstructures",
- "Error Suppresion / Optional Operator: ?" : "ErrorSuppresion/OptionalOperator:?",
+ "Error Suppression / Optional Operator: ?" : "ErrorSuppression/OptionalOperator:?",
"Conditionals and Comparisons" : "ConditionalsandComparisons"
,
@@ -7242,12 +7441,16 @@ Complex assignments
"Variable / Symbolic Binding Operator: ... as $identifier | ..." : "Variable/SymbolicBindingOperator:...as$identifier|...",
+ "Destructuring Alternative Operator: ?//" : "DestructuringAlternativeOperator:?//",
+
"Defining Functions" : "DefiningFunctions",
"Scoping" : "Scoping",
"Reduce" : "Reduce",
+ "isempty(exp)" : "isempty(exp)",
+
"limit(n; exp)" : "limit(n;exp)",
"first(expr), last(expr), nth(n; expr)" : "first(expr),last(expr),nth(n;expr)",
@@ -7317,6 +7520,10 @@ Complex assignments
"modulemeta" : "modulemeta",
"Modules" : "Modules"
+ ,
+
+
+ "Colors" : "Colors"
};
diff --git a/manual/v1.6/index.html b/manual/v1.6/index.html
new file mode 100644
index 00000000..247188a3
--- /dev/null
+++ b/manual/v1.6/index.html
@@ -0,0 +1,7532 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <script>
+ if ((window.location.host == "stedolan.github.io") && (window.location.protocol != "https:"))
+ window.location.protocol = "https";
+ </script>
+ <meta charset="utf-8">
+ <title>jq Manual (development version)</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+ <link rel="canonical" href="https://stedolan.github.io/jq/manual/v1.6/" />
+ <link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.5/spacelab/bootstrap.min.css" rel="stylesheet" integrity="sha256-j7Dtnd7ZjexEiPNbscbopFn9+Cs0b3TLipKsWAPHZIM= sha512-RFhfi6P8zWMAJrEGU+CPjuxPh3r/UUBGqQ+/o6WKPIVZmQqeOipGotH2ihRULuQ8wsMBoK15TSZqc/7VYWyuIw==" crossorigin="anonymous">
+ <link rel="stylesheet" href="/jq/css/base.css" type="text/css">
+ <!--[if lt IE 9]>
+ <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
+ <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
+ <![endif]-->
+ </head>
+
+
+ <body id="v1.6" data-spy="scroll" data-target="#navcolumn" data-offset="100">
+ <div class="navbar navbar-default navbar-fixed-top" role="navigation">
+ <div class="container">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#nav-collapse">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"