Update URLs from stedolan to jqlang
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Stephen Dolan · committed by Stephen Dolan · parent eb610c0 · Browse files · 19 files·+490 added−265 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
19 files+490 added−265 removed
- other:+490 added−265 removed
Provenance
- Commit
89caf46- Tree
d6ec603- Author
Stephen Dolan <stephen.dolan@cl.cam.ac.uk>- Committer
Stephen Dolan <stephen.dolan@cl.cam.ac.uk>- Parent
eb610c0
19 files changed+490 added−265 removed
modified:docs/content/download/default.yml+34 added-34 removed
33 unmodified lines34 [Arch](https://www.archlinux.org/packages/?sort=&q=jq&maintainer=&flagged=)35 repository. Install using `sudo pacman -S jq`.36 37 * jq 1.6 binaries for38- [64-bit](https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64)38+ [64-bit](https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64)39 or40- [32-bit](https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux32).40+ [32-bit](https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux32).41 42 * jq 1.5 binaries for43- [64-bit](https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64)43+ [64-bit](https://github.com/jqlang/jq/releases/download/jq-1.5/jq-linux64)44 or45- [32-bit](https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux32).45+ [32-bit](https://github.com/jqlang/jq/releases/download/jq-1.5/jq-linux32).46 47 * jq 1.4 binaries for48- [64-bit](https://github.com/stedolan/jq/releases/download/jq-1.4/jq-linux-x86_64)48+ [64-bit](https://github.com/jqlang/jq/releases/download/jq-1.4/jq-linux-x86_64)49 or50- [32-bit](https://github.com/stedolan/jq/releases/download/jq-1.4/jq-linux-x86).50+ [32-bit](https://github.com/jqlang/jq/releases/download/jq-1.4/jq-linux-x86).51 52 * jq 1.3 binaries for53- [64-bit](https://github.com/stedolan/jq/releases/download/jq-1.3/jq-linux-x86_64)53+ [64-bit](https://github.com/jqlang/jq/releases/download/jq-1.3/jq-linux-x86_64)54 or55- [32-bit](https://github.com/stedolan/jq/releases/download/jq-1.3/jq-linux-x86).55+ [32-bit](https://github.com/jqlang/jq/releases/download/jq-1.3/jq-linux-x86).56 57 ### OS X58 59 * Use [Fink](https://finkproject.org) to install jq 1.6 with5 unmodified lines65 * Use [MacPorts](https://www.macports.org) to install jq 1.6 with66 `port install jq`.67 68 * jq 1.6 binary for69- [64-bit](https://github.com/stedolan/jq/releases/download/jq-1.6/jq-osx-amd64).69+ [64-bit](https://github.com/jqlang/jq/releases/download/jq-1.6/jq-osx-amd64).70 71 * jq 1.5 binary for72- [64-bit](https://github.com/stedolan/jq/releases/download/jq-1.5/jq-osx-amd64).72+ [64-bit](https://github.com/jqlang/jq/releases/download/jq-1.5/jq-osx-amd64).73 74 * jq 1.4 binaries for75- [64-bit](https://github.com/stedolan/jq/releases/download/jq-1.4/jq-osx-x86_64)75+ [64-bit](https://github.com/jqlang/jq/releases/download/jq-1.4/jq-osx-x86_64)76 or77- [32-bit](https://github.com/stedolan/jq/releases/download/jq-1.4/jq-osx-x86).77+ [32-bit](https://github.com/jqlang/jq/releases/download/jq-1.4/jq-osx-x86).78 79 * jq 1.3 binaries for80- [64-bit](https://github.com/stedolan/jq/releases/download/jq-1.3/jq-osx-x86_64)80+ [64-bit](https://github.com/jqlang/jq/releases/download/jq-1.3/jq-osx-x86_64)81 or82- [32-bit](https://github.com/stedolan/jq/releases/download/jq-1.3/jq-osx-x86).82+ [32-bit](https://github.com/jqlang/jq/releases/download/jq-1.3/jq-osx-x86).83 84 ### FreeBSD85 86 * `pkg install jq` as root installs a pre-built9 unmodified lines96 * `pkgutil -i jq` in [OpenCSW](https://www.opencsw.org/p/jq) for Solaris97 10+, Sparc and x86.98 99 * jq 1.4 binaries for Solaris 11100- [64-bit](https://github.com/stedolan/jq/releases/download/jq-1.4/jq-solaris11-64)100+ [64-bit](https://github.com/jqlang/jq/releases/download/jq-1.4/jq-solaris11-64)101 or102- [32-bit](https://github.com/stedolan/jq/releases/download/jq-1.4/jq-solaris11-32).102+ [32-bit](https://github.com/jqlang/jq/releases/download/jq-1.4/jq-solaris11-32).103 104 ### Windows105 106 * Use [Chocolatey NuGet](https://chocolatey.org/) to install jq 1.6 with107 `chocolatey install jq`.108 109 * jq 1.6 executables for110- [64-bit](https://github.com/stedolan/jq/releases/download/jq-1.6/jq-win64.exe)110+ [64-bit](https://github.com/jqlang/jq/releases/download/jq-1.6/jq-win64.exe)111 or112- [32-bit](https://github.com/stedolan/jq/releases/download/jq-1.6/jq-win32.exe).112+ [32-bit](https://github.com/jqlang/jq/releases/download/jq-1.6/jq-win32.exe).113 114 * jq 1.5 executables for115- [64-bit](https://github.com/stedolan/jq/releases/download/jq-1.5/jq-win64.exe)115+ [64-bit](https://github.com/jqlang/jq/releases/download/jq-1.5/jq-win64.exe)116 or117- [32-bit](https://github.com/stedolan/jq/releases/download/jq-1.5/jq-win32.exe).117+ [32-bit](https://github.com/jqlang/jq/releases/download/jq-1.5/jq-win32.exe).118 119 * jq 1.4 executables for120- [64-bit](https://github.com/stedolan/jq/releases/download/jq-1.4/jq-win64.exe)120+ [64-bit](https://github.com/jqlang/jq/releases/download/jq-1.4/jq-win64.exe)121 or122- [32-bit](https://github.com/stedolan/jq/releases/download/jq-1.4/jq-win32.exe).122+ [32-bit](https://github.com/jqlang/jq/releases/download/jq-1.4/jq-win32.exe).123 124 * jq 1.3 executables for125- [64-bit](https://github.com/stedolan/jq/releases/download/jq-1.3/jq-win64.exe)125+ [64-bit](https://github.com/jqlang/jq/releases/download/jq-1.3/jq-win64.exe)126 or127- [32-bit](https://github.com/stedolan/jq/releases/download/jq-1.3/jq-win32.exe).127+ [32-bit](https://github.com/jqlang/jq/releases/download/jq-1.3/jq-win32.exe).128 129 ### Checksums and signatures130 131 SHA-256 checksums are provided for all release and pre-release binaries.132 They can be found under133- [sig/v1.x/sha256sum.txt](https://github.com/stedolan/jq/tree/master/sig).133+ [sig/v1.x/sha256sum.txt](https://github.com/jqlang/jq/tree/master/sig).134 The checksums for jq 1.6 are in135- [sig/v1.6/sha256sum.txt](https://raw.githubusercontent.com/stedolan/jq/master/sig/v1.6/sha256sum.txt).135+ [sig/v1.6/sha256sum.txt](https://raw.githubusercontent.com/jqlang/jq/master/sig/v1.6/sha256sum.txt).136 The checksums for jq 1.5 are in137- [sig/v1.5/sha256sum.txt](https://raw.githubusercontent.com/stedolan/jq/master/sig/v1.5/sha256sum.txt).137+ [sig/v1.5/sha256sum.txt](https://raw.githubusercontent.com/jqlang/jq/master/sig/v1.5/sha256sum.txt).138 139 Additionally, all binaries are signed by the140- [jq Package Signing Key](https://raw.githubusercontent.com/stedolan/jq/master/sig/jq-release.key).140+ [jq Package Signing Key](https://raw.githubusercontent.com/jqlang/jq/master/sig/jq-release.key).141 The signatures can be found under142- [sig/v1.x/\*.asc](https://github.com/stedolan/jq/tree/master/sig).142+ [sig/v1.x/\*.asc](https://github.com/jqlang/jq/tree/master/sig).143 The signatures for jq 1.6 are in144- [sig/v1.5/\*.asc](https://github.com/stedolan/jq/tree/master/sig/v1.6).144+ [sig/v1.5/\*.asc](https://github.com/jqlang/jq/tree/master/sig/v1.6).145 The signatures for jq 1.5 are in146- [sig/v1.5/\*.asc](https://github.com/stedolan/jq/tree/master/sig/v1.5).146+ [sig/v1.5/\*.asc](https://github.com/jqlang/jq/tree/master/sig/v1.5).147 You can use [GnuPG](https://gnupg.org/) to verify a signature by downloading148 the signature and running `gpg --verify signature.asc`.149 150 ### From source on Linux, OS X, Cygwin, and other POSIX-like operating systems151 152- * [Source tarball for jq 1.6](https://github.com/stedolan/jq/releases/download/jq-1.6/jq-1.6.tar.gz)153- * [Source tarball for jq 1.5](https://github.com/stedolan/jq/releases/download/jq-1.5/jq-1.5.tar.gz)152+ * [Source tarball for jq 1.6](https://github.com/jqlang/jq/releases/download/jq-1.6/jq-1.6.tar.gz)153+ * [Source tarball for jq 1.5](https://github.com/jqlang/jq/releases/download/jq-1.5/jq-1.5.tar.gz)154 155 You can build it using the usual `./configure && make && sudo156 make install` rigmarole.157 158 If you're interested in using the lastest development version, try:159 160- git clone --recursive https://github.com/stedolan/jq.git160+ git clone --recursive https://github.com/jqlang/jq.git161 cd jq162 autoreconf -i163 ./configure --disable-maintainer-mode164 make36 unmodified linesmodified:docs/content/manual/v1.3/manual.yml+1 added-1 removed
61 unmodified lines62 ## BUGS63 64 Presumably. Report them or discuss them at:65 66- https://github.com/stedolan/jq/issues66+ https://github.com/jqlang/jq/issues67 68 ## AUTHOR69 70 Stephen Dolan `<mu@netsoc.tcd.ie>`1200 unmodified linesmodified:docs/content/manual/v1.4/manual.yml+1 added-1 removed
61 unmodified lines62 ## BUGS63 64 Presumably. Report them or discuss them at:65 66- https://github.com/stedolan/jq/issues66+ https://github.com/jqlang/jq/issues67 68 ## AUTHOR69 70 Stephen Dolan `<mu@netsoc.tcd.ie>`1602 unmodified linesmodified:docs/content/manual/v1.5/manual.yml+1 added-1 removed
63 unmodified lines64 ## BUGS65 66 Presumably. Report them or discuss them at:67 68- https://github.com/stedolan/jq/issues68+ https://github.com/jqlang/jq/issues69 70 ## AUTHOR71 72 Stephen Dolan `<mu@netsoc.tcd.ie>`2806 unmodified linesmodified:docs/content/manual/v1.6/manual.yml+1 added-1 removed
63 unmodified lines64 ## BUGS65 66 Presumably. Report them or discuss them at:67 68- https://github.com/stedolan/jq/issues68+ https://github.com/jqlang/jq/issues69 70 ## AUTHOR71 72 Stephen Dolan `<mu@netsoc.tcd.ie>`3217 unmodified linesmodified:docs/content/manual/manual.yml+1 added-1 removed
64 unmodified lines65 ## BUGS66 67 Presumably. Report them or discuss them at:68 69- https://github.com/stedolan/jq/issues69+ https://github.com/jqlang/jq/issues70 71 ## AUTHOR72 73 Stephen Dolan `<mu@netsoc.tcd.ie>`3315 unmodified linesmodified:docs/content/tutorial/default.yml+142 added-132 removed
3 unmodified lines4 5 GitHub has a JSON API, so let's play with that. This URL gets us the last6 5 commits from the jq repo.7 8- - command: "curl 'https://api.github.com/repos/stedolan/jq/commits?per_page=5'"8+ - command: "curl 'https://api.github.com/repos/jqlang/jq/commits?per_page=5'"9 result: |10 [11 {12- "sha": "d25341478381063d1c76e81b3a52e0592a7c997f",12+ "sha": "cff5336ec71b6fee396a95bb0e4bea365e0cd1e8",13+ "node_id": "C_kwDOAE3WVdoAKGNmZjUzMzZlYzcxYjZmZWUzOTZhOTViYjBlNGJlYTM2NWUwY2QxZTg",14 "commit": {15 "author": {15- "name": "Stephen Dolan",16- "email": "mu@netsoc.tcd.ie",17- "date": "2013-06-22T16:30:59Z"16+ "name": "Mattias Wadman",17+ "email": "mattias.wadman@gmail.com",18+ "date": "2021-06-09T14:02:22Z"19 },20 "committer": {20- "name": "Stephen Dolan",21- "email": "mu@netsoc.tcd.ie",22- "date": "2013-06-22T16:30:59Z"21+ "name": "Nico Williams",22+ "email": "nico@cryptonector.com",23+ "date": "2022-05-26T21:04:32Z"24 },24- "message": "Merge pull request #162 from stedolan/utf8-fixes\n\nUtf8 fixes. Closes #161",25+ "message": "docs: Document repeat(exp)",26 "tree": {26- "sha": "6ab697a8dfb5a96e124666bf6d6213822599fb40",27- "url": "https://api.github.com/repos/stedolan/jq/git/trees/6ab697a8dfb5a96e124666bf6d6213822599fb40"27+ "sha": "d67d5542df1f16d1a48e1fb75749f60482cd874b",28+ "url": "https://api.github.com/repos/jqlang/jq/git/trees/d67d5542df1f16d1a48e1fb75749f60482cd874b"29 },29- "url": "https://api.github.com/repos/stedolan/jq/git/commits/d25341478381063d1c76e81b3a52e0592a7c997f",30- "comment_count": 030+ "url": "https://api.github.com/repos/jqlang/jq/git/commits/cff5336ec71b6fee396a95bb0e4bea365e0cd1e8",31+ "comment_count": 0,32+ "verification": {33+ "verified": false,34+ "reason": "unsigned",35+ "signature": null,36+ "payload": null37+ }38 },32- "url": "https://api.github.com/repos/stedolan/jq/commits/d25341478381063d1c76e81b3a52e0592a7c997f",33- "html_url": "https://github.com/stedolan/jq/commit/d25341478381063d1c76e81b3a52e0592a7c997f",34- "comments_url": "https://api.github.com/repos/stedolan/jq/commits/d25341478381063d1c76e81b3a52e0592a7c997f/comments",39+ "url": "https://api.github.com/repos/jqlang/jq/commits/cff5336ec71b6fee396a95bb0e4bea365e0cd1e8",40+ "html_url": "https://github.com/jqlang/jq/commit/cff5336ec71b6fee396a95bb0e4bea365e0cd1e8",41+ "comments_url": "https://api.github.com/repos/jqlang/jq/commits/cff5336ec71b6fee396a95bb0e4bea365e0cd1e8/comments",42 "author": {36- "login": "stedolan",43 ...44 45 - text: |46 1 unmodified line48 helpful to pipe the response through jq to pretty-print it. The simplest49 jq program is the expression `.`, which takes the input and produces it50 unchanged as output.51 46- - command: "curl 'https://api.github.com/repos/stedolan/jq/commits?per_page=5' | jq '.'"52+ - command: "curl 'https://api.github.com/repos/jqlang/jq/commits?per_page=5' | jq '.'"53 result: |54 [55 {50- "sha": "d25341478381063d1c76e81b3a52e0592a7c997f",56+ "sha": "cff5336ec71b6fee396a95bb0e4bea365e0cd1e8",57+ "node_id": "C_kwDOAE3WVdoAKGNmZjUzMzZlYzcxYjZmZWUzOTZhOTViYjBlNGJlYTM2NWUwY2QxZTg",58 "commit": {59 "author": {53- "name": "Stephen Dolan",54- "email": "mu@netsoc.tcd.ie",55- "date": "2013-06-22T16:30:59Z"60+ "name": "Mattias Wadman",61+ "email": "mattias.wadman@gmail.com",62+ "date": "2021-06-09T14:02:22Z"63 },64 "committer": {58- "name": "Stephen Dolan",59- "email": "mu@netsoc.tcd.ie",60- "date": "2013-06-22T16:30:59Z"65+ "name": "Nico Williams",66+ "email": "nico@cryptonector.com",67+ "date": "2022-05-26T21:04:32Z"68 },62- "message": "Merge pull request #162 from stedolan/utf8-fixes\n\nUtf8 fixes. Closes #161",69+ "message": "docs: Document repeat(exp)",70 "tree": {64- "sha": "6ab697a8dfb5a96e124666bf6d6213822599fb40",65- "url": "https://api.github.com/repos/stedolan/jq/git/trees/6ab697a8dfb5a96e124666bf6d6213822599fb40"71+ "sha": "d67d5542df1f16d1a48e1fb75749f60482cd874b",72+ "url": "https://api.github.com/repos/jqlang/jq/git/trees/d67d5542df1f16d1a48e1fb75749f60482cd874b"73 },67- "url": "https://api.github.com/repos/stedolan/jq/git/commits/d25341478381063d1c76e81b3a52e0592a7c997f",68- "comment_count": 074+ "url": "https://api.github.com/repos/jqlang/jq/git/commits/cff5336ec71b6fee396a95bb0e4bea365e0cd1e8",75+ "comment_count": 0,76+ "verification": {77+ "verified": false,78+ "reason": "unsigned",79+ "signature": null,80+ "payload": null81+ }82 },70- "url": "https://api.github.com/repos/stedolan/jq/commits/d25341478381063d1c76e81b3a52e0592a7c997f",71- "html_url": "https://github.com/stedolan/jq/commit/d25341478381063d1c76e81b3a52e0592a7c997f",72- "comments_url": "https://api.github.com/repos/stedolan/jq/commits/d25341478381063d1c76e81b3a52e0592a7c997f/comments",83+ "url": "https://api.github.com/repos/jqlang/jq/commits/cff5336ec71b6fee396a95bb0e4bea365e0cd1e8",84+ "html_url": "https://github.com/jqlang/jq/commit/cff5336ec71b6fee396a95bb0e4bea365e0cd1e8",85+ "comments_url": "https://api.github.com/repos/jqlang/jq/commits/cff5336ec71b6fee396a95bb0e4bea365e0cd1e8/comments",86 "author": {74- "login": "stedolan",87 ...88 89 - text: |90 91 We can use jq to extract just the first commit.92 81- - command: "curl 'https://api.github.com/repos/stedolan/jq/commits?per_page=5' | jq '.[0]'"93+ - command: "curl 'https://api.github.com/repos/jqlang/jq/commits?per_page=5' | jq '.[0]'"94 result: |95 {84- "sha": "d25341478381063d1c76e81b3a52e0592a7c997f",96+ "sha": "cff5336ec71b6fee396a95bb0e4bea365e0cd1e8",97+ "node_id": "C_kwDOAE3WVdoAKGNmZjUzMzZlYzcxYjZmZWUzOTZhOTViYjBlNGJlYTM2NWUwY2QxZTg",98 "commit": {99 "author": {87- "name": "Stephen Dolan",88- "email": "mu@netsoc.tcd.ie",89- "date": "2013-06-22T16:30:59Z"100+ "name": "Mattias Wadman",101+ "email": "mattias.wadman@gmail.com",102+ "date": "2021-06-09T14:02:22Z"103 },104 "committer": {92- "name": "Stephen Dolan",93- "email": "mu@netsoc.tcd.ie",94- "date": "2013-06-22T16:30:59Z"105+ "name": "Nico Williams",106+ "email": "nico@cryptonector.com",107+ "date": "2022-05-26T21:04:32Z"108 },96- "message": "Merge pull request #162 from stedolan/utf8-fixes\n\nUtf8 fixes. Closes #161",109+ "message": "docs: Document repeat(exp)",110 "tree": {98- "sha": "6ab697a8dfb5a96e124666bf6d6213822599fb40",99- "url": "https://api.github.com/repos/stedolan/jq/git/trees/6ab697a8dfb5a96e124666bf6d6213822599fb40"111+ "sha": "d67d5542df1f16d1a48e1fb75749f60482cd874b",112+ "url": "https://api.github.com/repos/jqlang/jq/git/trees/d67d5542df1f16d1a48e1fb75749f60482cd874b"113 },101- "url": "https://api.github.com/repos/stedolan/jq/git/commits/d25341478381063d1c76e81b3a52e0592a7c997f",102- "comment_count": 0114+ "url": "https://api.github.com/repos/jqlang/jq/git/commits/cff5336ec71b6fee396a95bb0e4bea365e0cd1e8",115+ "comment_count": 0,116+ "verification": {117+ "verified": false,118+ "reason": "unsigned",119+ "signature": null,120+ "payload": null121+ }122 },104- "url": "https://api.github.com/repos/stedolan/jq/commits/d25341478381063d1c76e81b3a52e0592a7c997f",105- "html_url": "https://github.com/stedolan/jq/commit/d25341478381063d1c76e81b3a52e0592a7c997f",106- "comments_url": "https://api.github.com/repos/stedolan/jq/commits/d25341478381063d1c76e81b3a52e0592a7c997f/comments",123+ "url": "https://api.github.com/repos/jqlang/jq/commits/cff5336ec71b6fee396a95bb0e4bea365e0cd1e8",124+ "html_url": "https://github.com/jqlang/jq/commit/cff5336ec71b6fee396a95bb0e4bea365e0cd1e8",125+ "comments_url": "https://api.github.com/repos/jqlang/jq/commits/cff5336ec71b6fee396a95bb0e4bea365e0cd1e8/comments",126 "author": {108- "login": "stedolan",109- "id": 79765,110- "avatar_url": "https://avatars.githubusercontent.com/u/79765?v=3",127+ "login": "wader",128+ "id": 185566,129+ "node_id": "MDQ6VXNlcjE4NTU2Ng==",130+ "avatar_url": "https://avatars.githubusercontent.com/u/185566?v=4",131 "gravatar_id": "",112- "url": "https://api.github.com/users/stedolan",113- "html_url": "https://github.com/stedolan",114- "followers_url": "https://api.github.com/users/stedolan/followers",115- "following_url": "https://api.github.com/users/stedolan/following{/other_user}",116- "gists_url": "https://api.github.com/users/stedolan/gists{/gist_id}",117- "starred_url": "https://api.github.com/users/stedolan/starred{/owner}{/repo}",118- "subscriptions_url": "https://api.github.com/users/stedolan/subscriptions",119- "organizations_url": "https://api.github.com/users/stedolan/orgs",120- "repos_url": "https://api.github.com/users/stedolan/repos",121- "events_url": "https://api.github.com/users/stedolan/events{/privacy}",122- "received_events_url": "https://api.github.com/users/stedolan/received_events",132+ "url": "https://api.github.com/users/wader",133+ "html_url": "https://github.com/wader",134+ "followers_url": "https://api.github.com/users/wader/followers",135+ "following_url": "https://api.github.com/users/wader/following{/other_user}",136+ "gists_url": "https://api.github.com/users/wader/gists{/gist_id}",137+ "starred_url": "https://api.github.com/users/wader/starred{/owner}{/repo}",138+ "subscriptions_url": "https://api.github.com/users/wader/subscriptions",139+ "organizations_url": "https://api.github.com/users/wader/orgs",140+ "repos_url": "https://api.github.com/users/wader/repos",141+ "events_url": "https://api.github.com/users/wader/events{/privacy}",142+ "received_events_url": "https://api.github.com/users/wader/received_events",143 "type": "User",144 "site_admin": false145 },146 "committer": {127- "login": "stedolan",128- "id": 79765,129- "avatar_url": "https://avatars.githubusercontent.com/u/79765?v=3",147+ "login": "nicowilliams",148+ "id": 604851,149+ "node_id": "MDQ6VXNlcjYwNDg1MQ==",150+ "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=4",151 "gravatar_id": "",131- "url": "https://api.github.com/users/stedolan",132- "html_url": "https://github.com/stedolan",133- "followers_url": "https://api.github.com/users/stedolan/followers",134- "following_url": "https://api.github.com/users/stedolan/following{/other_user}",135- "gists_url": "https://api.github.com/users/stedolan/gists{/gist_id}",136- "starred_url": "https://api.github.com/users/stedolan/starred{/owner}{/repo}",137- "subscriptions_url": "https://api.github.com/users/stedolan/subscriptions",138- "organizations_url": "https://api.github.com/users/stedolan/orgs",139- "repos_url": "https://api.github.com/users/stedolan/repos",140- "events_url": "https://api.github.com/users/stedolan/events{/privacy}",141- "received_events_url": "https://api.github.com/users/stedolan/received_events",152+ "url": "https://api.github.com/users/nicowilliams",153+ "html_url": "https://github.com/nicowilliams",154+ "followers_url": "https://api.github.com/users/nicowilliams/followers",155+ "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}",156+ "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}",157+ "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}",158+ "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions",159+ "organizations_url": "https://api.github.com/users/nicowilliams/orgs",160+ "repos_url": "https://api.github.com/users/nicowilliams/repos",161+ "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}",162+ "received_events_url": "https://api.github.com/users/nicowilliams/received_events",163 "type": "User",164 "site_admin": false165 },166 "parents": [167 {147- "sha": "54b9c9bdb225af5d886466d72f47eafc51acb4f7",148- "url": "https://api.github.com/repos/stedolan/jq/commits/54b9c9bdb225af5d886466d72f47eafc51acb4f7",149- "html_url": "https://github.com/stedolan/jq/commit/54b9c9bdb225af5d886466d72f47eafc51acb4f7"150- },151- {152- "sha": "8b1b503609c161fea4b003a7179b3fbb2dd4345a",153- "url": "https://api.github.com/repos/stedolan/jq/commits/8b1b503609c161fea4b003a7179b3fbb2dd4345a",154- "html_url": "https://github.com/stedolan/jq/commit/8b1b503609c161fea4b003a7179b3fbb2dd4345a"168+ "sha": "f2ad9517c72f6267ae317639ab56bbfd4a8653d4",169+ "url": "https://api.github.com/repos/jqlang/jq/commits/f2ad9517c72f6267ae317639ab56bbfd4a8653d4",170+ "html_url": "https://github.com/jqlang/jq/commit/f2ad9517c72f6267ae317639ab56bbfd4a8653d4"171 }172 ]173 }174 7 unmodified lines182 183 - command: "jq '.[0] | {message: .commit.message, name: .commit.committer.name}'"184 result: |185 {170- "message": "Merge pull request #162 from stedolan/utf8-fixes\n\nUtf8 fixes. Closes #161",171- "name": "Stephen Dolan"186+ "message": "docs: Document repeat(exp)",187+ "name": "Nico Williams"188 }189 190 - text: |191 6 unmodified lines198 199 - command: "jq '.[] | {message: .commit.message, name: .commit.committer.name}'"200 result: |201 {186- "message": "Merge pull request #162 from stedolan/utf8-fixes\n\nUtf8 fixes. Closes #161",187- "name": "Stephen Dolan"202+ "message": "docs: Document repeat(exp)",203+ "name": "Nico Williams"204 }205 {190- "message": "Reject all overlong UTF8 sequences.",191- "name": "Stephen Dolan"206+ "message": "Mention -n in IO-section and for input/inputs",207+ "name": "Nico Williams"208 }209 {194- "message": "Fix various UTF8 parsing bugs.\n\nIn particular, parse bad UTF8 by replacing the broken bits with U+FFFD\nand resychronise correctly after broken sequences.",195- "name": "Stephen Dolan"210+ "message": "Fix iterration problem for non decimal string\n\nWhen the string transformation to number failed, all following\ntransformation failed too.\n\nThis happend because status in decNumberFromString function is\nupdated just in error case. Reusing the DEC_CONTEXT that failed\nbefore results into error even if the string is valid number.",211+ "name": "Nico Williams"212 }213 {198- "message": "Fix example in manual for `floor`. See #155.",199- "name": "Stephen Dolan"214+ "message": "docs: point to Libera.Chat instead of Freenode",215+ "name": "Nico Williams"216 }217 {202- "message": "Document floor",203- "name": "Nicolas Williams"218+ "message": "Missing \"va_end\" call. This was found by running the cppcheck static analysis where it shows as error.",219+ "name": "Nico Williams"220 }221 222 - text: |223 16 unmodified lines240 - command: "jq '[.[] | {message: .commit.message, name: .commit.committer.name}]'"241 result: |242 [243 {228- "message": "Merge pull request #163 from stedolan/utf8-fixes\n\nUtf8 fixes. Closes #161",229- "name": "Stephen Dolan"244+ "message": "docs: Document repeat(exp)",245+ "name": "Nico Williams"246 },247 {232- "message": "Reject all overlong UTF8 sequences.",233- "name": "Stephen Dolan"248+ "message": "Mention -n in IO-section and for input/inputs",249+ "name": "Nico Williams"250 },251 {236- "message": "Fix various UTF8 parsing bugs.\n\nIn particular, parse bad UTF8 by replacing the broken bits with U+FFFD\nand resychronise correctly after broken sequences.",237- "name": "Stephen Dolan"252+ "message": "Fix iterration problem for non decimal string\n\nWhen the string transformation to number failed, all following\ntransformation failed too.\n\nThis happend because status in decNumberFromString function is\nupdated just in error case. Reusing the DEC_CONTEXT that failed\nbefore results into error even if the string is valid number.",253+ "name": "Nico Williams"254 },255 {240- "message": "Fix example in manual for `floor`. See #155.",241- "name": "Stephen Dolan"256+ "message": "docs: point to Libera.Chat instead of Freenode",257+ "name": "Nico Williams"258 },259 {244- "message": "Document floor",245- "name": "Nicolas Williams"260+ "message": "Missing \"va_end\" call. This was found by running the cppcheck static analysis where it shows as error.",261+ "name": "Nico Williams"262 }263 ]264 265 - text: |5 unmodified lines271 about "parent" commits. There can be one or many.272 273 "parents": [274 {259- "sha": "54b9c9bdb225af5d886466d72f47eafc51acb4f7",260- "url": "https://api.github.com/repos/stedolan/jq/commits/54b9c9bdb225af5d886466d72f47eafc51acb4f7",261- "html_url": "https://github.com/stedolan/jq/commit/54b9c9bdb225af5d886466d72f47eafc51acb4f7"262- },263- {264- "sha": "8b1b503609c161fea4b003a7179b3fbb2dd4345a",265- "url": "https://api.github.com/repos/stedolan/jq/commits/8b1b503609c161fea4b003a7179b3fbb2dd4345a",266- "html_url": "https://github.com/stedolan/jq/commit/8b1b503609c161fea4b003a7179b3fbb2dd4345a"275+ "sha": "f2ad9517c72f6267ae317639ab56bbfd4a8653d4",276+ "url": "https://api.github.com/repos/jqlang/jq/commits/f2ad9517c72f6267ae317639ab56bbfd4a8653d4",277+ "html_url": "https://github.com/jqlang/jq/commit/f2ad9517c72f6267ae317639ab56bbfd4a8653d4"278 }279 ]280 281 We want to pull out all of the "html_url" fields inside that array of parent3 unmodified lines285 - command: "jq '[.[] | {message: .commit.message, name: .commit.committer.name, parents: [.parents[].html_url]}]'"286 result: |287 [288 {278- "message": "Merge pull request #162 from stedolan/utf8-fixes\n\nUtf8 fixes. Closes #161",279- "name": "Stephen Dolan",289+ "message": "docs: Document repeat(exp)",290+ "name": "Nico Williams",291 "parents": [281- "https://github.com/stedolan/jq/commit/54b9c9bdb225af5d886466d72f47eafc51acb4f7",282- "https://github.com/stedolan/jq/commit/8b1b503609c161fea4b003a7179b3fbb2dd4345a"292+ "https://github.com/jqlang/jq/commit/f2ad9517c72f6267ae317639ab56bbfd4a8653d4"293 ]294 },295 {286- "message": "Reject all overlong UTF8 sequences.",287- "name": "Stephen Dolan",296+ "message": "Mention -n in IO-section and for input/inputs",297+ "name": "Nico Williams",298 "parents": [289- "https://github.com/stedolan/jq/commit/ff48bd6ec538b01d1057be8e93b94eef6914e9ef"299+ "https://github.com/jqlang/jq/commit/c4d39c4d22f2b12225ca1b311708f7e084ad9ff8"300 ]301 },302 {293- "message": "Fix various UTF8 parsing bugs.\n\nIn particular, parse bad UTF8 by replacing the broken bits with U+FFFD\nand resychronise correctly after broken sequences.",294- "name": "Stephen Dolan",303+ "message": "Fix iterration problem for non decimal string\n\nWhen the string transformation to number failed, all following\ntransformation failed too.\n\nThis happend because status in decNumberFromString function is\nupdated just in error case. Reusing the DEC_CONTEXT that failed\nbefore results into error even if the string is valid number.",304+ "name": "Nico Williams",305 "parents": [296- "https://github.com/stedolan/jq/commit/54b9c9bdb225af5d886466d72f47eafc51acb4f7"306+ "https://github.com/jqlang/jq/commit/174db0f93552bdb551ae1f3c5c64744df0ad8e2f"307 ]308 },309 {300- "message": "Fix example in manual for `floor`. See #155.",301- "name": "Stephen Dolan",310+ "message": "docs: point to Libera.Chat instead of Freenode",311+ "name": "Nico Williams",312 "parents": [303- "https://github.com/stedolan/jq/commit/3dcdc582ea993afea3f5503a78a77675967ecdfa"313+ "https://github.com/jqlang/jq/commit/29cf77977ef52eec708982b19bf9d2ec17443337"314 ]315 },316 {307- "message": "Document floor",308- "name": "Nicolas Williams",317+ "message": "Missing \"va_end\" call. This was found by running the cppcheck static analysis where it shows as error.",318+ "name": "Nico Williams",319 "parents": [310- "https://github.com/stedolan/jq/commit/7c4171d414f647ab08bcd20c76a4d8ed68d9c602"320+ "https://github.com/jqlang/jq/commit/55e6e2c21829bd866bd4b18ee254b05c9020320a"321 ]322 }323 ]324 13 unmodified linesmodified:docs/content/index.yml+4 added-4 removed
33 unmodified lines3435363738383940414243444546474848495051525354555556575859606161626364657 unmodified lines33 unmodified linesnews: - date: 1 November 2018 body: | jq 1.6 released. See installation options on the [download](/jq/download/) page, and the [release notes](https://github.com/stedolan/jq/releases/tag/jq-1.6) page, and the [release notes](https://github.com/jqlang/jq/releases/tag/jq-1.6) for details.
- date: 15 August 2015 body: |
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 [download](/jq/download/) page, and the [release notes](https://github.com/stedolan/jq/releases/tag/jq-1.5) [release notes](https://github.com/jqlang/jq/releases/tag/jq-1.5) for details.
- date: 26 July 2015 body: |
jq 1.5rc2 is available. Get it on the [releases](https://github.com/stedolan/jq/releases) page. [releases](https://github.com/jqlang/jq/releases) page.
- date: 01 January 2015 body: |
jq 1.5rc1 is available. Get it on the [releases](https://github.com/stedolan/jq/releases) page. [releases](https://github.com/jqlang/jq/releases) page.
- date: 09 June 2014 body: |
7 unmodified linesmodified:docs/templates/shared/_head.html.j2+1 added-1 removed
1 <head>2 <script>3- if ((window.location.host == "stedolan.github.io") && (window.location.protocol != "https:"))3+ if ((window.location.host == "jqlang.github.io") && (window.location.protocol != "https:"))4 window.location.protocol = "https";5 </script>6 <meta charset="utf-8">7 <title>{{headline}}</title>10 unmodified linesmodified:docs/templates/shared/_navbar.html.j2+3 added-3 removed
15 unmodified lines16 <li {% if item == navitem %} class="active" {% endif %}>17 <a href="{{root}}/{{item}}/">{{item | capitalize}}</a>18 </li>19 {% endfor %}20- <li><a href="https://github.com/stedolan/jq/issues">Issues</a></li>21- <li><a href="https://github.com/stedolan/jq">Source</a></li>20+ <li><a href="https://github.com/jqlang/jq/issues">Issues</a></li>21+ <li><a href="https://github.com/jqlang/jq">Source</a></li>22 <li><a href="https://jqplay.org">Try online!</a></li>23- <li><a href="https://raw.githubusercontent.com/stedolan/jq/master/NEWS">News</a></li>23+ <li><a href="https://raw.githubusercontent.com/jqlang/jq/master/NEWS">News</a></li>24 </ul>25 </div>26 </div>27 </div>modified:docs/templates/index.html.j2+3 added-3 removed
22 unmodified lines23 Download jq 1.624 <span class="caret"></span>25 </a>26 <ul class="dropdown-menu">27- <li><a href="https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64">Linux (64-bit)</a></li>28- <li><a href="https://github.com/stedolan/jq/releases/download/jq-1.6/jq-osx-amd64">OS X (64-bit)</a></li>29- <li><a href="https://github.com/stedolan/jq/releases/download/jq-1.6/jq-win64.exe">Windows (64-bit)</a></li>27+ <li><a href="https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64">Linux (64-bit)</a></li>28+ <li><a href="https://github.com/jqlang/jq/releases/download/jq-1.6/jq-osx-amd64">OS X (64-bit)</a></li>29+ <li><a href="https://github.com/jqlang/jq/releases/download/jq-1.6/jq-win64.exe">Windows (64-bit)</a></li>30 <li><a href="{{root}}/download/">Other platforms, older versions, and source</a></li>31 </ul>32 </div>33 40 unmodified linesmodified:docs/build_manpage.py+1 added-1 removed
185 unmodified lines186 pass187 188 def load_yml_file(fn):189 with open(fn) as f:190- return yaml.load(f)190+ return yaml.load(f, Loader=yaml.Loader)191 192 def dedent_body(body):193 lines = [re.sub(r'^ (\S)', r'\1', l) for l in body.split('\n')]194 return '\n'.join(lines)41 unmodified linesmodified:docs/site.yml+2 added-2 removed
1 # The key value pairs found below are available within the templates.2 3-url: https://stedolan.github.io/jq3+url: https://jqlang.github.io/jq4 5 # This line is modified by the Makefile. To change the version number,6 # edit the Autoconf version number at the top of configure.ac7-jq_version: "1.4-2-g15c4a7f-dirty"7+jq_version: "1.6-159-gcff5336-dirty"8 9 root: '/jq'modified:src/main.c+2 added-2 removed
58 unmodified lines59 "The simplest filter is ., which copies jq's input to its output\n"60 "unmodified (except for formatting, but note that IEEE754 is used\n"61 "for number representation internally, with all that that implies).\n\n"62 "For more advanced filters see the jq(1) manpage (\"man jq\")\n"63- "and/or https://stedolan.github.io/jq\n\n"63+ "and/or https://jqlang.github.io/jq\n\n"64 "Example:\n\n\t$ echo '{\"foo\": 0}' | jq .\n"65 "\t{\n\t\t\"foo\": 0\n\t}\n\n",66 JQ_VERSION, progname, progname, progname);67 if (keep_it_short) {28 unmodified lines96 }97 98 static void die() {99 fprintf(stderr, "Use %s --help for help with command-line options,\n", progname);100- fprintf(stderr, "or see the jq manpage, or online docs at https://stedolan.github.io/jq\n");100+ fprintf(stderr, "or see the jq manpage, or online docs at https://jqlang.github.io/jq\n");101 exit(2);102 }103 104 621 unmodified linesmodified:configure.ac+2 added-2 removed
1 unmodified line2 m4_esyscmd_s([(git rev-parse --verify -q jq-1.0 > /dev/null &&3 (git describe --tags --dirty --match 'jq-*'|sed 's/^jq-//')) ||4 echo `git rev-parse --abbrev-ref HEAD`-`git describe --always --dirty`])))5 6-AC_INIT([jq], [jq_version], [https://github.com/stedolan/jq/issues],7- [jq], [https://stedolan.github.io/jq])6+AC_INIT([jq], [jq_version], [https://github.com/jqlang/jq/issues],7+ [jq], [https://jqlang.github.io/jq])8 9 dnl Created autoconf implementation thompson@dtosolutions, 26NOV1210 AC_PREREQ([2.64])11 AC_CONFIG_AUX_DIR([config])288 unmodified linesmodified:jq.1.prebuilt+285 added-70 removed
1-.\" generated with Ronn/v0.7.32-.\" http://github.com/rtomayko/ronn/tree/0.7.31 .4-.TH "JQ" "1" "December 2017" "" ""2+.TH "JQ" "1" "May 2023" "" ""3 .4 .SH "NAME"5 \fBjq\fR \- Command\-line JSON processor6 .6 unmodified lines13 .P14 \fBjq\fR can accept text input as well, but by default, \fBjq\fR reads a stream of JSON entities (including numbers and other literals) from \fBstdin\fR\. Whitespace is only needed to separate entities such as 1 and 2, and true and false\. One or more \fIfiles\fR may be specified, in which case \fBjq\fR will read input from those instead\.15 .16 .P19-The \fIoptions\fR are described in the \fIINVOKING JQ\fR section; they mostly concern input and output formatting\. The \fIfilter\fR is written in the jq language and specifies how to transform the input file or document\.17+The \fIoptions\fR are described in the [INVOKING JQ] section; they mostly concern input and output formatting\. The \fIfilter\fR is written in the jq language and specifies how to transform the input file or document\.18 .19 .SH "FILTERS"20 A jq program is a "filter": 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, or various other standard tasks\.21 .17 unmodified lines39 .40 .P41 You can affect how jq reads and writes its input and output using some command\-line options:42 .45-.IP "\(bu" 443+.TP44 \fB\-\-version\fR:45 .46 .IP47 Output the jq version and exit with zero\.48 .51-.IP "\(bu" 449+.TP50 \fB\-\-seq\fR:51 .52 .IP53 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\.54 .57-.IP "\(bu" 455+.TP56 \fB\-\-stream\fR:57 .58 .IP61-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[[1,0],"b"]\fR\.59+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\.60 .61 .IP62 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\.63 .66-.IP "\(bu" 464+.TP65 \fB\-\-slurp\fR/\fB\-s\fR:66 .67 .IP68 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\.69 .72-.IP "\(bu" 470+.TP71 \fB\-\-raw\-input\fR/\fB\-R\fR:72 .73 .IP74 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\.75 .78-.IP "\(bu" 476+.TP77 \fB\-\-null\-input\fR/\fB\-n\fR:78 .79 .IP80 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\.81 .84-.IP "\(bu" 482+.TP83 \fB\-\-compact\-output\fR / \fB\-c\fR:84 .85 .IP86 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\.87 .90-.IP "\(bu" 488+.TP89 \fB\-\-tab\fR:90 .91 .IP92 Use a tab for each indentation level instead of two spaces\.93 .96-.IP "\(bu" 494+.TP95 \fB\-\-indent n\fR:96 .97 .IP98 Use the given number of spaces (no more than 7) for indentation\.99 .102-.IP "\(bu" 4100+.TP101 \fB\-\-color\-output\fR / \fB\-C\fR and \fB\-\-monochrome\-output\fR / \fB\-M\fR:102 .103 .IP104 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 \fB\-C\fR, and disable color with \fB\-M\fR\.105 .106 .IP107 Colors can be configured with the \fBJQ_COLORS\fR environment variable (see below)\.108 .111-.IP "\(bu" 4109+.TP110+\fB\-\-binary\fR / \fB\-b\fR:111+.112+.IP113+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)\.114+.115+.TP116 \fB\-\-ascii\-output\fR / \fB\-a\fR:117 .118 .IP119 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\.120 .117-.IP "\(bu" 4118-\fB\-\-unbuffered\fR121+.TP122+\fB\-\-unbuffered\fR:123 .124 .IP125 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)\.126 .123-.IP "\(bu" 4127+.TP128 \fB\-\-sort\-keys\fR / \fB\-S\fR:129 .130 .IP131 Output the fields of each object with the keys in sorted order\.132 .129-.IP "\(bu" 4133+.TP134 \fB\-\-raw\-output\fR / \fB\-r\fR:135 .136 .IP137 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\.138 .135-.IP "\(bu" 4139+.TP140 \fB\-\-join\-output\fR / \fB\-j\fR:141 .142 .IP143 Like \fB\-r\fR but jq won\'t print a newline after each output\.144 .141-.IP "\(bu" 4145+.TP146+\fB\-\-nul\-output\fR / \fB\-0\fR:147+.148+.IP149+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\.150+.151+.TP152 \fB\-f filename\fR / \fB\-\-from\-file filename\fR:153 .154 .IP155 Read filter from the file rather than from a command line, like awk\'s \-f option\. You can also use \'#\' to make comments\.156 .147-.IP "\(bu" 4157+.TP158 \fB\-Ldirectory\fR / \fB\-L directory\fR:159 .160 .IP161 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\.162 .153-.IP "\(bu" 4163+.TP164 \fB\-e\fR / \fB\-\-exit\-status\fR:165 .166 .IP167 Sets the exit status of jq to 0 if the last output values 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\.168 .169 .IP170 Another way to set the exit status is with the \fBhalt_error\fR builtin function\.171 .162-.IP "\(bu" 4172+.TP173 \fB\-\-arg name value\fR:174 .175 .IP176 This option passes a value to the jq program as a predefined variable\. If you run jq with \fB\-\-arg foo bar\fR, then \fB$foo\fR is available in the program and has the value \fB"bar"\fR\. Note that \fBvalue\fR will be treated as a string, so \fB\-\-arg foo 123\fR will bind \fB$foo\fR to \fB"123"\fR\.177 .178 .IP179 Named arguments are also available to the jq program as \fB$ARGS\.named\fR\.180 .171-.IP "\(bu" 4181+.TP182 \fB\-\-argjson name JSON\-text\fR:183 .184 .IP185 This option passes a JSON\-encoded value to the jq program as a predefined variable\. If you run jq with \fB\-\-argjson foo 123\fR, then \fB$foo\fR is available in the program and has the value \fB123\fR\.186 .177-.IP "\(bu" 4187+.TP188 \fB\-\-slurpfile variable\-name filename\fR:189 .190 .IP181-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 \fB\-\-argfile foo bar\fR, then \fB$foo\fR is available in the program and has an array whose elements correspond to the texts in the file named \fBbar\fR\.191+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 \fB\-\-slurpfile foo bar\fR, then \fB$foo\fR is available in the program and has an array whose elements correspond to the texts in the file named \fBbar\fR\.192 .183-.IP "\(bu" 4193+.TP194+\fB\-\-rawfile variable\-name filename\fR:195+.196+.IP197+This option reads in the named file and binds its contents to the given global variable\. If you run jq with \fB\-\-rawfile foo bar\fR, then \fB$foo\fR is available in the program and has a string whose contents are to the texts in the file named \fBbar\fR\.198+.199+.TP200 \fB\-\-argfile variable\-name filename\fR:201 .202 .IP203 Do not use\. Use \fB\-\-slurpfile\fR instead\.204 .205 .IP206 (This option is like \fB\-\-slurpfile\fR, but when the file has just one text, then that is used, else an array of texts is used as in \fB\-\-slurpfile\fR\.)207 .192-.IP "\(bu" 4208+.TP209 \fB\-\-args\fR:210 .211 .IP212 Remaining arguments are positional string arguments\. These are available to the jq program as \fB$ARGS\.positional[]\fR\.213 .198-.IP "\(bu" 4214+.TP215 \fB\-\-jsonargs\fR:216 .217 .IP218 Remaining arguments are positional JSON text arguments\. These are available to the jq program as \fB$ARGS\.positional[]\fR\.219 .204-.IP "\(bu" 4220+.TP221 \fB\-\-run\-tests [filename]\fR:222 .223 .IP224 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\.225 .226 .IP227 Be warned that this option can change backwards\-incompatibly\.228 .213-.IP "" 0214-.229 .SH "BASIC FILTERS"230 .231 .SS "Identity: \."232 The absolute simplest filter is \fB\.\fR \. This is a filter that takes its input and produces it unchanged as output\. That is, this is the identity operator\.233 .234 .P235 Since jq by default pretty\-prints all output, this trivial program can be a useful way of formatting JSON output from, say, \fBcurl\fR\.236 .237+.P238+An important point about the identity filter is that it guarantees to preserve the literal decimal representation of values\. This is particularly important when dealing with numbers which can\'t be losslessly converted to an IEEE754 double precision representation\.239+.240+.P241+jq doesn\'t truncate the literal numbers to double unless there is a need to make arithmetic operations with the number\. Comparisions are carried out over the untruncated big decimal representation of the number\.242+.243+.P244+jq will also try to maintain the original decimal precision of the provided number literal\. See below for examples\. 245+.246 .IP "" 4247 .248 .nf249 250 jq \'\.\'251 "Hello, world!"252 => "Hello, world!"253+254+jq \'\. | tojson\'255+ 12345678909876543212345256+=> "12345678909876543212345"257+258+jq \'map([\., \. == 1]) | tojson\'259+ [1, 1\.000, 1\.0, 100e\-2]260+=> "[[1,true],[1\.000,true],[1\.0,true],[1\.00,true]]"261+262+jq \'\. as $big | [$big, $big + 1] | map(\. > 10000000000000000000000000000000)\'263+ 10000000000000000000000000000001264+=> [true, false]265 .266 .fi267 .268 .IP "" 07 unmodified lines276 .P277 This syntax only works for simple, identifier\-like keys, that is, keys that are all made of alphanumeric characters and underscore, and which do not start with a digit\.278 .279 .P245-If the key contains special characters, you need to surround it with double quotes like this: \fB\."foo$"\fR, or else \fB\.["foo$"]\fR\.280+If the key contains special characters or starts with a digit, you need to surround it with double quotes like this: \fB\."foo$"\fR, or else \fB\.["foo$"]\fR\.281 .282 .P283 For example \fB\.["foo::bar"]\fR and \fB\.["foo\.bar"]\fR work while \fB\.foo::bar\fR does not, and \fB\.foo\.bar\fR means \fB\.["foo"]\.["bar"]\fR\.284 .115 unmodified lines400 => {"name":"JSON", "good":true}, {"name":"XML", "good":false}401 402 jq \'\.[]\'403 []369-=>404+=> 405 406 jq \'\.[]\'407 {"a": 1, "b": 1}408 => 1, 172 unmodified lines481 .482 .P483 Booleans, null, strings and numbers are written the same way as in javascript\. Just like everything else in jq, these simple values take an input and produce an output \- \fB42\fR is a valid jq expression that takes an input, ignores it, and returns 42 instead\.484 .485+.P486+Numbers in jq are internally represented by their IEEE754 double precision approximation\. Any arithmetic operation with numbers, whether they are literals or results of previous filters, will produce a double precision floating point result\.487+.488+.P489+However, when parsing a literal jq will store the original literal string\. If no mutation is applied to this value then it will make to the output in its original form, even if conversion to double would result in a loss\. 490+.491 .SS "Array construction: []"492 As in JSON, \fB[]\fR is used to construct arrays, as in \fB[1,2,3]\fR\. The elements of the arrays can be any jq expression, including a pipeline\. All of the results produced by all of the expressions are collected into one big array\. You can use it to construct an array out of a known quantity of values (as in \fB[\.foo, \.bar, \.baz]\fR) or to "collect" all the results of a filter into an array (as in \fB[\.items[]\.name]\fR)493 .494 .P21 unmodified lines516 .SS "Object Construction: {}"517 Like JSON, \fB{}\fR is for constructing objects (aka dictionaries or hashes), as in: \fB{"a": 42, "b": 17}\fR\.518 .519 .P479-If the keys are "identifier\-like", then the quotes can be left off, as in \fB{a:42, b:17}\fR\. Keys generated by expressions need to be parenthesized, e\.g\., \fB{("a"+"b"):59}\fR\.520+If the keys are "identifier\-like", then the quotes can be left off, as in \fB{a:42, b:17}\fR\. Variable references as key expressions use the value of the variable as the key\. Key expressions other than constant literals, identifiers, or variable references, need to be parenthesized, e\.g\., \fB{("a"+"b"):59}\fR\.521 .522 .P482-The value can be any expression (although you may need to wrap it in parentheses if it\'s a complicated one), which gets applied to the {} expression\'s input (remember, all filters have an input and an output)\.523+The value can be any expression (although you may need to wrap it in parentheses if, for example, it contains colons), which gets applied to the {} expression\'s input (remember, all filters have an input and an output)\.524 .525 .IP "" 4526 .527 .nf80 unmodified lines608 .609 .nf610 611 {"stedolan": ["JQ Primer", "More JQ"]}612+.613+.fi614+.615+.IP "" 0616+.617+.P618+Variable references as keys use the value of the variable as the key\. Without a value then the variable\'s name becomes the key and its value becomes the value,619+.620+.IP "" 4621+.622+.nf623 624+"f o o" as $foo | "b a r" as $bar | {$foo, $bar:$foo}625+.626+.fi627+.628+.IP "" 0629+.630+.P631+produces632+.633+.IP "" 4634+.635+.nf636+637+{"f o o":"f o o","b a r":"f o o"}638+639 jq \'{user, title: \.titles[]}\'640 {"user":"stedolan","titles":["JQ Primer", "More JQ"]}641 => {"user":"stedolan", "title": "JQ Primer"}, {"user":"stedolan", "title": "More JQ"}642 25 unmodified lines668 .669 .SH "BUILTIN OPERATORS AND FUNCTIONS"670 Some jq operator (for instance, \fB+\fR) do different things depending on the type of their arguments (arrays, numbers, etc\.)\. However, jq never does implicit type conversions\. If you try to add a string to an object you\'ll get an error message and no result\.671 .672+.P673+Please note that all numbers are converted to IEEE754 double precision floating point representation\. Arithmetic and logical operators are working with these converted doubles\. Results of all such operations are also limited to the double precision\. 674+.675+.P676+The only exception to this behaviour of number is a snapshot of original number literal\. When a number which originally was provided as a literal is never mutated until the end of the program then it is printed to the output in its original literal form\. This also includes cases when the original literal would be truncated when converted to the IEEE754 double precision floating point number\.677+.678 .SS "Addition: +"679 The operator \fB+\fR takes two filters, applies them both to the same input, and adds the results together\. What "adding" means depends on the types involved:680 .681 .IP "\(bu" 4110 unmodified lines792 .793 .IP "\(bu" 4794 The length of \fBnull\fR is zero\.795 .723-.IP724-jq \'\.[] | length\' [[1,2], "string", {"a":2}, null] => 2, 6, 1, 0796+.IP "" 4797 .798+.nf799+800+jq \'\.[] | length\'801+ [[1,2], "string", {"a":2}, null]802+=> 2, 6, 1, 0803+.804+.fi805+.806 .IP "" 0807 .808 .SS "utf8bytelength"809 The builtin function \fButf8bytelength\fR outputs the number of bytes used to encode a string in UTF\-8\.308 unmodified lines1118 .P1119 The given \fBexit_code\fR (defaulting to \fB5\fR) will be jq\'s exit status\.1120 .1121 .P1042-For example, \fB"Error: something went wrong\en"|halt_error(1)\fR\.1122+For example, \fB"Error: somthing went wrong\en"|halt_error(1)\fR\.1123 .1124 .SS "$__loc__"1125 Produces an object with a "file" key and a "line" key, with the filename and line number where \fB$__loc__\fR occurs, as values\.1126 .153 unmodified lines1280 .fi1281 .1282 .IP "" 01283 .1204-.SS "range(upto), range(from;upto) range(from;upto;by)"1284+.SS "range(upto), range(from;upto), range(from;upto;by)"1285 The \fBrange\fR function produces a range of numbers\. \fBrange(4;10)\fR produces 6 numbers, from 4 (inclusive) to 10 (exclusive)\. The numbers are produced as separate outputs\. Use \fB[range(4;10)]\fR to get a range as an array\.1286 .1287 .P1288 The one argument form generates numbers from 0 to the given number, with an increment of 1\.538 unmodified lines1827 .fi1828 .1829 .IP "" 01830 .1831+.SS "repeat(exp)"1832+The \fBrepeat(exp)\fR function allows you to repeatedly apply expression \fBexp\fR to \fB\.\fR until an error is raised\.1833+.1834+.P1835+Note that \fBrepeat(exp)\fR is internally defined as a recursive jq function\. Recursive calls within \fBrepeat\fR will not consume additional memory if \fBexp\fR produces at most one output for each input\. See advanced topics below\.1836+.1837+.IP "" 41838+.1839+.nf1840+1841+jq \'[repeat(\.*2, error)?]\'1842+ 11843+=> [2]1844+.1845+.fi1846+.1847+.IP "" 01848+.1849 .SS "until(cond; next)"1850 The \fBuntil(cond; next)\fR function allows you to repeatedly apply the expression \fBnext\fR, initially to \fB\.\fR then to its own output, until \fBcond\fR is true\. For example, this can be used to implement a factorial function (see below)\.1851 .1852 .P137 unmodified lines1990 .1991 .IP "" 01992 .1993 .SS "bsearch(x)"1896-bsearch(x) conducts a binary search for x in the input array\. If the input is sorted and contains x, then bsearch(x) will return its index in the array; otherwise, if the array is sorted, it will return (\-1 \- ix) where ix is an insertion point such that the array would still be sorted after the insertion of x at ix\. If the array is not sorted, bsearch(x) will return an integer that is probably of no interest\.1994+\fBbsearch(x)\fR conducts a binary search for x in the input array\. If the input is sorted and contains x, then \fBbsearch(x)\fR will return its index in the array; otherwise, if the array is sorted, it will return (\-1 \- ix) where ix is an insertion point such that the array would still be sorted after the insertion of x at ix\. If the array is not sorted, \fBbsearch(x)\fR will return an integer that is probably of no interest\.1995 .1996 .IP "" 41997 .1998 .nf29 unmodified lines2028 .2029 .IP "" 02030 .2031 .SS "Convert to/from JSON"1934-The \fBtojson\fR and \fBfromjson\fR builtins dump values as JSON texts or parse JSON texts into values, respectively\. The tojson builtin differs from tostring in that tostring returns strings unmodified, while tojson encodes strings as JSON strings\.2032+The \fBtojson\fR and \fBfromjson\fR builtins dump values as JSON texts or parse JSON texts into values, respectively\. The \fBtojson\fR builtin differs from \fBtostring\fR in that \fBtostring\fR returns strings unmodified, while \fBtojson\fR encodes strings as JSON strings\.2033 .2034 .IP "" 42035 .2036 .nf68 unmodified lines2105 .TP2106 \fB@base64d\fR:2107 .2108 .IP2011-The inverse of \fB@base64\fR, input is decoded as specified by RFC 4648\. Note: If the decoded string is not UTF\-8, the results are undefined\.2109+The inverse of \fB@base64\fR, input is decoded as specified by RFC 4648\. Note\e: If the decoded string is not UTF\-8, the results are undefined\.2110 .2111 .P2112 This syntax can be combined with string interpolation in a useful way\. You can follow a \fB@foo\fR token with a string literal\. The contents of the string literal will \fInot\fR be escaped\. However, all interpolations made inside that string literal will be escaped\. For instance,2113 .171 unmodified lines2285 .SS "if\-then\-else"2286 \fBif A then B else C end\fR will act the same as \fBB\fR if \fBA\fR produces a value other than false or null, but act the same as \fBC\fR otherwise\.2287 .2288 .P2191-Checking for false or null is a simpler notion of "truthiness" than is found in Javascript or Python, but it means that you\'ll sometimes have to be more explicit about the condition you want: you can\'t test whether, e\.g\. a string is empty using \fBif \.name then A else B end\fR, you\'ll need something more like \fBif (\.name | length) > 0 then A else B end\fR instead\.2289+\fBif A then B end\fR is the same as \fBif A then B else \. end\fR\. That is, the \fBelse\fR branch is optional, and if absent is the same as \fB\.\fR\.2290 .2291 .P2292+Checking for false or null is a simpler notion of "truthiness" than is found in Javascript or Python, but it means that you\'ll sometimes have to be more explicit about the condition you want\. You can\'t test whether, e\.g\. a string is empty using \fBif \.name then A else B end\fR, you\'ll need something more like \fBif \.name == "" then A else B end\fR instead\.2293+.2294+.P2295 If the condition \fBA\fR produces multiple results, then \fBB\fR is evaluated once for each result that is not false or null, and \fBC\fR is evaluated once for each false or null\.2296 .2297 .P2298 More cases can be added to an if using \fBelif A then B\fR syntax\.1 unmodified line2300 .IP "" 42301 .2302 .nf2303 2203-jq \'if \. == 0 then2304+jq \'if \. == 0 then "zero" elif \. == 1 then "one" else "many" end\'2305+ 22306+=> "many"2307 .2308 .fi2309 .2310 .IP "" 02311 .2209-.P2210-"zero" elif \. == 1 then "one" else "many" end\' 2 => "many"2211-.2312 .SS ">, >=, <=, <"2313 The comparison operators \fB>\fR, \fB>=\fR, \fB<=\fR, \fB<\fR return whether their left argument is greater than, greater than or equal to, less than or equal to or less than their right argument (respectively)\.2314 .2315 .P196 unmodified lines2512 .2513 .IP "" 02514 .2515 .P2416-where: * STRING, REGEX and FLAGS are jq strings and subject to jq string interpolation; * REGEX, after string interpolation, should be a valid PCRE regex; * FILTER is one of \fBtest\fR, \fBmatch\fR, or \fBcapture\fR, as described below\.2516+where:2517 .2518+.IP "\(bu" 42519+STRING, REGEX and FLAGS are jq strings and subject to jq string interpolation;2520+.2521+.IP "\(bu" 42522+REGEX, after string interpolation, should be a valid PCRE regex;2523+.2524+.IP "\(bu" 42525+FILTER is one of \fBtest\fR, \fBmatch\fR, or \fBcapture\fR, as described below\.2526+.2527+.IP "" 02528+.2529 .P2530 FLAGS is a string consisting of one of more of the supported flags:2531 .2532 .IP "\(bu" 425 unmodified lines2558 .P2559 To match whitespace in an x pattern use an escape such as \es, e\.g\.2560 .2561 .IP "\(bu" 42451-test( "a\esb", "x" )\.2562+test( "a\e\esb"; "x" )2563 .2564 .IP "" 02565 .2566 .P114 unmodified lines2681 .2682 .SS "splits(regex), splits(regex; flags)"2683 These provide the same results as their \fBsplit\fR counterparts, but as a stream instead of an array\.2684 .2574-.SS "sub(regex; tostring) sub(regex; string; flags)"2685+.SS "sub(regex; tostring), sub(regex; string; flags)"2686 Emit the string obtained by replacing the first match of regex in the input string with \fBtostring\fR, after interpolation\. \fBtostring\fR should be a jq string, and may contain references to named captures\. The named captures are, in effect, presented as a JSON object (as constructed by \fBcapture\fR) to \fBtostring\fR, so a reference to a captured variable named "x" would take the form: "(\.x)"\.2687 .2688 .SS "gsub(regex; string), gsub(regex; string; flags)"2689 \fBgsub\fR is like \fBsub\fR but all the non\-overlapping occurrences of the regex are replaced by the string, after interpolation\.77 unmodified lines2767 .IP "" 42768 .2769 .nf2770 2660-\&\.realnames as $names | \.posts[] | {title, author: $names[\.author]}2771+\&.realnames as $names | \.posts[] | {title, author: $names[\.author]}2772 .2773 .fi2774 .2775 .IP "" 010 unmodified lines2786 .IP "" 42787 .2788 .nf2789 2679-\&\. as {realnames: $names, posts: [$first, $second]} | \.\.\.2790+\&. as {realnames: $names, posts: [$first, $second]} | \.\.\.2791 .2792 .fi2793 .2794 .IP "" 07 unmodified lines2802 .IP "" 42803 .2804 .nf2805 2695-\&\.realnames as $names | (\.posts[] | {title, author: $names[\.author]})2806+\&.realnames as $names | (\.posts[] | {title, author: $names[\.author]})2807 .2808 .fi2809 .2810 .IP "" 040 unmodified lines2851 .fi2852 .2853 .IP "" 02854 .2855+.SS "Destructuring Alternative Operator: ?//"2856+The destructuring alternative operator provides a concise mechanism for destructuring an input that can take one of several forms\.2857+.2858+.P2859+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:2860+.2861+.IP "" 42862+.2863+.nf2864+2865+{"resources": [{"id": 1, "kind": "widget", "events": {"action": "create", "user_id": 1, "ts": 13}},2866+ {"id": 2, "kind": "widget", "events": [{"action": "create", "user_id": 1, "ts": 14}, {"action": "destroy", "user_id": 1, "ts": 15}]}]}2867+.2868+.fi2869+.2870+.IP "" 02871+.2872+.P2873+We can use the destructuring alternative operator to handle this structural change simply:2874+.2875+.IP "" 42876+.2877+.nf2878+2879+\&.resources[] as {$id, $kind, events: {$user_id, $ts}} ?// {$id, $kind, events: [{$user_id, $ts}]} | {$user_id, $kind, $id, $ts}2880+.2881+.fi2882+.2883+.IP "" 02884+.2885+.P2886+Or, if we aren\'t sure if the input is an array of values or an object:2887+.2888+.IP "" 42889+.2890+.nf2891+2892+\&.[] as [$id, $kind, $user_id, $ts] ?// {$id, $kind, $user_id, $ts} | \.\.\.2893+.2894+.fi2895+.2896+.IP "" 02897+.2898+.P2899+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 \fBnull\fR:2900+.2901+.IP "" 42902+.2903+.nf2904+2905+\&.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}2906+.2907+.fi2908+.2909+.IP "" 02910+.2911+.P2912+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\.2913+.2914+.IP "" 42915+.2916+.nf2917+2918+[[3]] | \.[] as [$a] ?// [$b] | if $a != null then error("err: \e($a)") else {$a,$b} end2919+2920+jq \'\.[] as {$a, $b, c: {$d, $e}} ?// {$a, $b, c: [{$d, $e}]} | {$a, $b, $d, $e}\'2921+ [{"a": 1, "b": 2, "c": {"d": 3, "e": 4}}, {"a": 1, "b": 2, "c": [{"d": 3, "e": 4}]}]2922+=> {"a":1,"b":2,"d":3,"e":4}, {"a":1,"b":2,"d":3,"e":4}2923+2924+jq \'\.[] as {$a, $b, c: {$d}} ?// {$a, $b, c: [{$e}]} | {$a, $b, $d, $e}\'2925+ [{"a": 1, "b": 2, "c": {"d": 3, "e": 4}}, {"a": 1, "b": 2, "c": [{"d": 3, "e": 4}]}]2926+=> {"a":1,"b":2,"d":3,"e":null}, {"a":1,"b":2,"d":null,"e":4}2927+2928+jq \'\.[] as [$a] ?// [$b] | if $a != null then error("err: \e($a)") else {$a,$b} end\'2929+ [[3]]2930+=> {"a":null,"b":3}2931+.2932+.fi2933+.2934+.IP "" 02935+.2936 .SS "Defining Functions"2937 You can give a filter a name using "def" syntax:2938 .2939 .IP "" 487 unmodified lines3027 .SS "Scoping"3028 There are two types of symbols in jq: value bindings (a\.k\.a\., "variables"), and functions\. Both are scoped lexically, with expressions being able to refer only to symbols that have been defined "to the left" of them\. The only exception to this rule is that functions can refer to themselves so as to be able to create recursive functions\.3029 .3030 .P2839-For example, in the following expression there is a binding which is visible "to the right" of it, \fB\.\.\. | \.*3 as $times_three | [\. + $times_three] | \.\.\.\fR, but not "to the left"\. Consider this expression now, \fB\.\.\. | (\.*3 as $times_three | [\.+ $times_three]) | \.\.\.\fR: here the binding \fB$times_three\fR is \fInot\fR visible past the closing parenthesis\.3031+For example, in the following expression there is a binding which is visible "to the right" of it, \fB\.\.\. | \.*3 as $times_three | [\. + $times_three] | \.\.\.\fR, but not "to the left"\. Consider this expression now, \fB\.\.\. | (\.*3 as $times_three | [\. + $times_three]) | \.\.\.\fR: here the binding \fB$times_three\fR is \fInot\fR visible past the closing parenthesis\.3032 .3033 .SS "Reduce"3034 The \fBreduce\fR syntax in jq allows you to combine all of the results of an expression by accumulating them into a single answer\. As an example, we\'ll pass \fB[3,2,1]\fR to this expression:3035 .191 unmodified lines3227 .P3228 See your system\'s manual for more information on each of these\.3229 .3230 .SH "I/O"3039-At this time jq has minimal support for I/O, mostly in the form of control over when inputs are read\. Two builtins functions are provided for this, \fBinput\fR and \fBinputs\fR, that read from the same sources (e\.g\., \fBstdin\fR, files named on the command\-line) as jq itself\. These two builtins, and jq\'s own reading actions, can be interleaved with each other\.3231+At this time jq has minimal support for I/O, mostly in the form of control over when inputs are read\. Two builtins functions are provided for this, \fBinput\fR and \fBinputs\fR, that read from the same sources (e\.g\., \fBstdin\fR, files named on the command\-line) as jq itself\. These two builtins, and jq\'s own reading actions, can be interleaved with each other\. They are commonly used in combination with the null input option \fB\-n\fR to prevent one input from being read implicitly\.3232 .3233 .P3234 Two builtins provide minimal output capabilities, \fBdebug\fR, and \fBstderr\fR\. (Recall that a jq program\'s output values are always output as JSON texts on \fBstdout\fR\.) The \fBdebug\fR builtin can have application\-specific behavior, such as for executables that use the libjq C API but aren\'t the jq executable itself\. The \fBstderr\fR builtin outputs its input in raw mode to stder with no additional decoration, not even a newline\.3235 .2 unmodified lines3238 .3239 .SS "input"3240 Outputs one new input\.3241 .3242+.P3243+Note that when using \fBinput\fR it is generally be necessary to invoke jq with the \-n command\-line option, otherwise the first entity will be lost\.3244+.3245 .SS "inputs"3246 Outputs all remaining inputs, one by one\.3247 .3248 .P3054-This is primarily useful for reductions over a program\'s inputs\.3249+This is primarily useful for reductions over a program\'s inputs\. Note that when using \fBinputs\fR it is generally necessary to invoke jq with the \-n command\-line option, otherwise the first entity will be lost\.3250 .3251 .SS "debug"3252 Causes a debug message based on the input value to be produced\. The jq executable wraps the input value with \fB["DEBUG:", <input\-value>]\fR and prints that and a newline on stderr, compactly\. This may change in the future\.3253 .143 unmodified lines3397 .3398 .P3399 Provide input \'{"a": {"b": 10}, "b": 20}\' to the programs:3400 .3206-.P3207-\&\.a = \.b3401+.IP "" 43402 .3209-.P3210-\&\.a |= \.b3403+.nf3404+3405+\&.a = \.b3406+3407+\&.a |= \.b3408 .3409+.fi3410+.3411+.IP "" 03412+.3413 .P3414 The former will set the "a" field of the input to the "b" field of the input, and produce the output {"a": 20, "b": 20}\. The latter will set the "a" field of the input to the "a" field\'s "b" field, producing {"a": 10, "b": 20}\.3415 .3416 .P3417 Another example of the difference between \'=\' and \'|=\':3418 .3218-.P3419+.IP "" 43420+.3421+.nf3422+3423 null|(\.a,\.b)=range(3)3424 .3425+.fi3426+.3427+.IP "" 03428+.3429 .P3430 outputs \'{"a":0,"b":0}\', \'{"a":1,"b":1}\', and \'{"a":2,"b":2}\', while3431 .3224-.P3432+.IP "" 43433+.3434+.nf3435+3436 null|(\.a,\.b)|=range(3)3437 .3438+.fi3439+.3440+.IP "" 03441+.3442 .P3443 outputs just \'{"a":0,"b":0}\'\.3444 .3445 .SS "Complex assignments"2 unmodified lines3448 .IP "" 43449 .3450 .nf3451 3237-\&\.posts[0]\.title = "JQ Manual"3452+\&.posts[0]\.title = "JQ Manual"3453 .3454 .fi3455 .3456 .IP "" 04 unmodified lines3461 .IP "" 43462 .3463 .nf3464 3250-\&\.posts[]\.comments |= \. + ["this is great"]3465+\&.posts[]\.comments |= \. + ["this is great"]3466 .3467 .fi3468 .3469 .IP "" 010 unmodified lines3480 .IP "" 43481 .3482 .nf3483 3269-\&\.posts[] | select(\.author == "stedolan")3484+\&.posts[] | select(\.author == "stedolan")3485 .3486 .fi3487 .3488 .IP "" 0113 unmodified lines3602 .3603 .IP "" 03604 .3605 .P3391-The default color scheme is the same as setting \fB"JQ_COLORS=1;30:0;39:0;39:0;39:0;32:1;39:1;39"\fR\.3606+The default color scheme is the same as setting \fB"JQ_COLORS=1;30:0;37:0;37:0;37:0;32:1;37:1;37"\fR\.3607 .3608 .P3609 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:3610 .52 unmodified lines3663 .IP "" 43664 .3665 .nf3666 3452-https://github\.com/stedolan/jq/issues3667+https://github\.com/jqlang/jq/issues3668 .3669 .fi3670 .3671 .IP "" 03 unmodified linesmodified:jq.spec+1 added-1 removed
3 unmodified lines4 Name: jq5 Version: %{myver}6 Release: %{myrel}%{?dist}7 Source0: jq-%{myver}.tar.gz8-URL: https://stedolan.github.io/jq8+URL: https://jqlang.github.io/jq9 License: BSD10 AutoReqProv: no11 #BuildPrereq: autoconf, libtool, automake, flex, bison, python12 58 unmodified linesmodified:libjq.pc.in+1 added-1 removed
2 unmodified lines3 libdir=@libdir@4 includedir=@includedir@5 6 Name: libjq7-URL: https://stedolan.github.io/jq/7+URL: https://jqlang.github.io/jq/8 Description: Library to process JSON using a query language9 Version: @VERSION@10 Libs: -L${libdir} -ljq11 Cflags: -I${includedir}modified:README.md+4 added-4 removed
7 unmodified lines8 Windows: [](https://ci.appveyor.com/project/stedolan/jq)9 10 11 If you want to learn to use jq, read the documentation at12-[https://stedolan.github.io/jq](https://stedolan.github.io/jq). This12+[https://jqlang.github.io/jq](https://jqlang.github.io/jq). This13 documentation is generated from the docs/ folder of this repository.14 You can also try it online at [jqplay.org](https://jqplay.org).15 16 If you want to hack on jq, feel free, but be warned that its internals17 are not well-documented at the moment. Bring a hard hat and a18-shovel. Also, read the wiki: https://github.com/stedolan/jq/wiki, where18+shovel. Also, read the wiki: https://github.com/jqlang/jq/wiki, where19 you will find cookbooks, discussion of advanced topics, internals,20 release engineering, and more.21 22 Source tarball and built executable releases can be found on the23-homepage and on the github release page, https://github.com/stedolan/jq/releases23+homepage and on the github release page, https://github.com/jqlang/jq/releases24 25 If you're building directly from the latest git, you'll need flex,26 bison (3.0 or newer), libtool, make, automake, and autoconf installed.27 To get regexp support you'll also need to install Oniguruma or clone it as a40 unmodified lines68 scripts/crosscompile <name-of-build> <configure-options>69 70 Use the `--host=` and `--target=` ./configure options to select a71 cross-compilation environment. See also72-["Cross compilation"](https://github.com/stedolan/jq/wiki/Cross-compilation) on72+["Cross compilation"](https://github.com/jqlang/jq/wiki/Cross-compilation) on73 the wiki.74 75 Send questions to https://stackoverflow.com/questions/tagged/jq or to the #jq channel (https://web.libera.chat/#jq) on Libera.Chat (https://libera.chat/).