Commit graph

8 commits

Author SHA1 Message Date
Ed Smith
a360504574 Implement tee -p and --output-error
This has the following behaviours. On Unix:

- The default is to exit on pipe errors, and warn on other errors.

- "--output-error=warn" means to warn on all errors

- "--output-error", "--output-error=warn-nopipe" and "-p" all mean
  that pipe errors are suppressed, all other errors warn.

- "--output-error=exit" means to warn and exit on all errors.

- "--output-error=exit-nopipe" means to suppress pipe errors, and to
  warn and exit on all other errors.

On non-Unix platforms, all pipe behaviours are ignored, so the default
is effectively "--output-error=warn" and "warn-nopipe" is identical.
The only meaningful option is "--output-error=exit" which is identical
to "--output-error=exit-nopipe" on these platforms.

Note that warnings give a non-zero exit code, but do not halt writing
to non-erroring targets.
2022-07-07 15:23:50 +02:00
Terts Diepraam
18369dc0be all: use array intoiterator 2022-04-05 10:39:31 +02:00
Daniel Eades
2f85610cc3 remove explicit iter loops 2022-01-30 15:08:26 +01:00
Terts Diepraam
448b84806f
fix Rust 1.58 clippy lints (#2874) 2022-01-16 15:57:33 +01:00
Jan Scheer
de757cb025 tee: refactor tests for #1982 2021-04-05 23:05:07 +02:00
Ivan
500771c78d
tee: should match GNU's output if used with /dev/full (#1944)
+ aligned 'tee' output with GNU tee when one of the files is '/dev/full'
+ don't stop tee when one of the outputs fails; just continue and return
error status from tee in the end

Co-authored-by: Ivan Rymarchyk <irymarchyk@arlo.com>
2021-03-27 20:02:49 +01:00
Jan Scheer
3ae714e88c
tests/tee: implemented tests for tee (#1804)
These tests are ported from `https://github.com/coreutils/coreutils/tests/misc/tee.sh`.
2021-03-27 09:16:45 +01:00
Roy Ivy III
1b3bb56e66 tests ~ add missing test_UTIL module files (with 'ToDO' comments)
- common_core utils
- additional 'windows' utils
- additional 'unix' utils
2020-06-02 11:25:09 -05:00