Skip to content

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 15 Sep 09:52
· 342 commits to main since this release
5e82af5

jz makes JSON from more than command output: from data files (CSV, TSV,
LTSV, JSON Lines, JSON and YAML, also gzip or bzip2 compressed) and from
arguments given to jz new. The registry is unchanged at 224 commands
and 596 definitions.

Added

  • jz new makes a JSON object from its arguments, or an array with
    --array: key=text is a string, key:=json a JSON value,
    key=@path a file's text, key:=@path the value a data file holds and
    key[]= one more element of an array. Nothing is guessed from a value,
    and a key given twice without [] is exit 2.
  • Data files: jz --file reads a file as the format its extension
    names, .csv, .tsv, .ltsv, .jsonl (or .ndjson), .json and
    .yaml (or .yml), each also compressed as .gz or .bz2, and
    --format NAME reads piped data as that format. JSON keeps its key
    order and number literals, YAML is typed by the 1.2 core schema, and a
    key given twice, text that is not UTF-8 or a value JSON cannot hold is
    exit 3 with the line. --stream writes JSON Lines and LTSV records as
    they are read. --explain says which format was read and what named
    it, and --explain=json counts the values in read.values.
  • The site has a Cookbook
    of 20 tasks, each run by the end-to-end suite, and a test fails when a
    documented command, the options block, the exit-code table or a demo
    tape no longer matches the command line.

Changed

  • A file given with --file whose extension names a data format is read
    as that format, where its text was detected as command output. Name
    --parser or --define to read such a file as a command's output;
    a file with any other extension (captured.txt) is detected as before.