]> git.ipfire.org Git - thirdparty/zstd.git/commit
Add explicit --pass-through flag and default to enabled for *cat (#3223)
authorNick Terrell <terrelln@fb.com>
Fri, 5 Aug 2022 00:15:59 +0000 (17:15 -0700)
committerGitHub <noreply@github.com>
Fri, 5 Aug 2022 00:15:59 +0000 (17:15 -0700)
commit03cc84fddb9747ddc63f76b6f3171cd8f66da202
tree2177b4b4ea2f2e4854668f16450df2e13bfeb4c0
parentd0dcc9d775789af73f44accb318579465ccdada4
Add explicit --pass-through flag and default to enabled for *cat (#3223)

Fixes #3211.

Adds the `--[no-]pass-through` flag which enables/disables pass-through mode.

* `zstdcat`, `zcat`, and `gzcat` default to `--pass-through`.
  Pass-through mode can be disabled by passing `--no-pass-through`.
* All other binaries default to not setting pass-through mode.
  However, we preserve the legacy behavior of enabling pass-through
  mode when writing to stdout with `-f` set, unless pass-through
  mode is explicitly disabled with `--no-pass-through`.

Adds a new test for this behavior that should codify the behavior we want.
programs/fileio.c
programs/fileio.h
programs/fileio_types.h
programs/zstdcli.c
tests/cli-tests/decompression/pass-through.sh [new file with mode: 0755]
tests/cli-tests/decompression/pass-through.sh.stderr.exact [new file with mode: 0644]
tests/cli-tests/decompression/pass-through.sh.stdout.exact [new file with mode: 0644]