miller/internal/pkg/cli
Eng Zer Jun 12f3b14ce6
Remove redundant nil check (#1367)
From the Go docs [1]:

  "1. For a nil slice, the number of iterations is 0."
  "3. If the map is nil, the number of iterations is 0."

Therefore, an additional nil check for before the loop is unnecessary.

[1]: https://go.dev/ref/spec#For_range

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-08-23 10:18:22 -04:00
..
doc.go Standardize Go-package structure (#746) 2021-11-11 14:15:13 -05:00
flag_types.go Remove redundant nil check (#1367) 2023-08-23 10:18:22 -04: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 Support ZSTD compression in-process (#1360) 2023-08-19 15:22:59 -04:00
option_types.go Implement --csv-trim-leading-space flag (#1272) 2023-04-20 13:13:55 -03:00
README.md Standardize Go-package structure (#746) 2021-11-11 14:15:13 -05:00
separators.go Make TSV finally true TSV (#923) 2022-02-06 00:13:55 -05:00
verb_utils.go Fix panic on 'mlr sort -n' 2022-03-28 23:26:37 -04: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.