miller/internal/pkg/cli
John Kerl da91878939
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
2022-01-09 11:11:54 -05:00
..
doc.go Standardize Go-package structure (#746) 2021-11-11 14:15:13 -05:00
flag_types.go Approximate-match feature for online help (#754) 2021-11-17 23:37:48 -05:00
flatten_unflatten.go Standardize Go-package structure (#746) 2021-11-11 14:15:13 -05:00
mlrcli_util.go Make --ifs-regex and --ips-regex explicit command-line flags (#799) 2021-12-25 00:00:18 -05:00
option_parse.go Distinguish between JSON and JSON Lines formats (#844) 2022-01-09 11:11:54 -05:00
option_types.go Distinguish between JSON and JSON Lines formats (#844) 2022-01-09 11:11:54 -05:00
README.md Standardize Go-package structure (#746) 2021-11-11 14:15:13 -05:00
separators.go Make --ifs-regex and --ips-regex explicit command-line flags (#799) 2021-12-25 00:00:18 -05:00
verb_utils.go More Go-package restructuring (#748) 2021-11-12 12:49:55 -05:00

Datatypes for parsing the Miller command line, and the flags table.

  • internal/pkg/climain is the flag-parsing logic for supporting Miller's command-line interface. When you type something like mlr --icsv --ojson put '$sum = $a + $b' then filter '$sum > 1000' myfile.csv, it's the CLI parser which makes it possible for Miller to construct a CSV record-reader, a transformer chain of put then filter, and a JSON record-writer.
  • internal/pkg/cli contains datatypes and the flags table for the CLI-parser, which was split out to avoid a Go package-import cycle.