mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-17 16:38:54 +00:00
JSONL output does not properly handle keys with quotes (#1425)
* mlr --l2j, --j2l * make dev for previous commit * fix #1424 * unit-test cases * iterate
This commit is contained in:
parent
f2a9ae5ca4
commit
5b6a1d4713
17 changed files with 90 additions and 54 deletions
|
|
@ -1680,6 +1680,21 @@ var FormatConversionKeystrokeSaverFlagSection = FlagSection{
|
|||
*pargi += 1
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--j2l",
|
||||
help: "Use JSON for input, JSONL for output.",
|
||||
// For format-conversion keystroke-savers, a matrix is plenty -- we don't
|
||||
// need to print a tedious 60-line list.
|
||||
suppressFlagEnumeration: true,
|
||||
parser: func(args []string, argc int, pargi *int, options *TOptions) {
|
||||
options.ReaderOptions.InputFileFormat = "json"
|
||||
options.WriterOptions.OutputFileFormat = "json"
|
||||
options.WriterOptions.WrapJSONOutputInOuterList = false
|
||||
options.WriterOptions.JSONOutputMultiline = false
|
||||
*pargi += 1
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: "--j2t",
|
||||
help: "Use JSON for input, TSV for output.",
|
||||
|
|
@ -1803,6 +1818,18 @@ var FormatConversionKeystrokeSaverFlagSection = FlagSection{
|
|||
*pargi += 1
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--l2j",
|
||||
help: "Use JSONL for input, JSON for output.",
|
||||
// For format-conversion keystroke-savers, a matrix is plenty -- we don't
|
||||
// need to print a tedious 60-line list.
|
||||
suppressFlagEnumeration: true,
|
||||
parser: func(args []string, argc int, pargi *int, options *TOptions) {
|
||||
options.ReaderOptions.InputFileFormat = "json"
|
||||
options.WriterOptions.OutputFileFormat = "json"
|
||||
*pargi += 1
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--l2n",
|
||||
help: "Use JSON Lines for input, NIDX for output.",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue