mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-17 16:38:54 +00:00
Distinguish between JSON and JSON Lines formats (#844)
* Draw a distinction between JSON and JSON Lines formats
* Add JSON Lines to on-line help example
* Have JSON format default to --jlistwrap and --jvstack
* Update test cases for --jlistwrap output for JSON output format
* Have JSON format default to --jlistwrap and --jvstack for --{X}2j as well
* Make --jlistwrap / --jvstack as legacy flags, since now --json and --jsonl
* Add --c2l, --l2c, etc. command-line flags
* docmods for JSON Lines
* Update regression-test cases for JSON / JSON Lines distinction
This commit is contained in:
parent
7143288689
commit
da91878939
438 changed files with 2538 additions and 1517 deletions
|
|
@ -106,6 +106,8 @@ However, in Miller 6 it has optional use for map traversal. Example:
|
|||
<pre class="pre-non-highlight-in-pair">
|
||||
bar.baz
|
||||
bar.baz
|
||||
[
|
||||
]
|
||||
</pre>
|
||||
|
||||
This also works on the left-hand sides of assignment statements:
|
||||
|
|
@ -116,6 +118,7 @@ This also works on the left-hand sides of assignment statements:
|
|||
<b>'</b>
|
||||
</pre>
|
||||
<pre class="pre-non-highlight-in-pair">
|
||||
[
|
||||
{
|
||||
"hostname": "localhost",
|
||||
"pid": 12345,
|
||||
|
|
@ -137,6 +140,7 @@ This also works on the left-hand sides of assignment statements:
|
|||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
</pre>
|
||||
|
||||
A few caveats:
|
||||
|
|
@ -150,6 +154,8 @@ A few caveats:
|
|||
</pre>
|
||||
<pre class="pre-non-highlight-in-pair">
|
||||
6989
|
||||
[
|
||||
]
|
||||
</pre>
|
||||
|
||||
* However (awkwardly), if you want to use `.` for map-traversal as well as string-concatenation in the same statement, you'll need to insert parentheses, as the default associativity is left-to-right:
|
||||
|
|
@ -161,6 +167,8 @@ A few caveats:
|
|||
</pre>
|
||||
<pre class="pre-non-highlight-in-pair">
|
||||
(error)
|
||||
[
|
||||
]
|
||||
</pre>
|
||||
|
||||
<pre class="pre-highlight-in-pair">
|
||||
|
|
@ -170,4 +178,6 @@ A few caveats:
|
|||
</pre>
|
||||
<pre class="pre-non-highlight-in-pair">
|
||||
GET -- api/check
|
||||
[
|
||||
]
|
||||
</pre>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue