Commit fb1afc0
Add tee-compatible append, ignore-interrupts, and output-error options
Adopt the parts of tee(1)'s option vocabulary that map onto t3's
command-runner model, so t3 is more familiar as a tee replacement (issue #1).
- -a, --append: open the log file with "a" so output is appended rather than
overwriting, e.g. to accumulate a log across multiple build steps.
- -i, --ignore-interrupts: t3 and its timestamp workers ignore SIGINT (set
before the workers are forked, so they inherit it) while the command child
restores the default disposition. A Ctrl-C therefore interrupts the command
but lets t3 drain the workers' remaining output and exit with the command's
status, instead of being torn down mid-flush and dropping the buffered tail.
- --output-error[=MODE]: choose what t3 does when a write to one of its
outputs fails - warn, warn-nopipe, exit, exit-nopipe, and tee's default
(exit on a broken pipe, diagnose other errors). SIGPIPE is ignored so a
closed consumer yields EPIPE for this logic rather than killing t3, and a
failed output is dropped while the others keep going - so
--output-error=warn-nopipe preserves the complete log file even when a
downstream reader of t3's own stdout/stderr (e.g. `t3 log -- cmd | head`)
goes away. The logfile's deferred write errors are reported at close.
t3's existing -p (--plain) deliberately does not take on tee's pipe-mode
meaning; pipe behavior is reached through --output-error=...-nopipe instead.
This divergence is noted in the README and man page.
Add golden tests for -a and --output-error, and document all three options in
the usage text, README, and man page.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 8e99e73 commit fb1afc0
5 files changed
Lines changed: 423 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
163 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
164 | 169 | | |
165 | 170 | | |
166 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
128 | 134 | | |
129 | 135 | | |
130 | 136 | | |
131 | 137 | | |
132 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
133 | 158 | | |
134 | 159 | | |
135 | 160 | | |
| |||
0 commit comments