You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When data is piped in and files are also given, the piped data is not used (unless a flag like --replacement-pipe says what it is for). Nothing tells about this. Only with --verbose there is a line: Piped data never used.
> cat notes.txt | rexreplace foo bar my.file
my.file
Change
Add warnings as a third kind of message, and use it for this case.
A warning starts with 🟡 and goes to stderr.
--quiet and --quiet-total hide it.
It never stops the run, also not with --halt.
--void-pipe means the piped data is not wanted, so there is no warning then.
> cat notes.txt | rexreplace foo bar my.file
🟡 Data is piped in, but no flag tells what to do with it. It is not used.
my.file
To decide
Empty piped data, or only a line break: is that also a warning? On the v8.0 branch it was not.
Good to know
This was made on the v8.0 branch, which is not merged, as warn() in src/output.ts. On that branch the run stopped after the warning, which looks like a mistake.
With --replacement-js the piped data can be used from the code as pipe, so there is no warning then.
"Error != warning" is on the list of future ideas in the README.
Reference
This was made before, on a branch that is not merged. Look at it to see how it was done. It can not be copied as it is, as it is written for older code.
Activity
Warn when piped data is not used (#719)
mathiasrw commentedon Oct 13, 2026
Implemented:
warn()insrc/output.ts, used for piped data that is not used. Empty piped data, or only a line break, gives no warning (as onv8.0).Fix files with absolute path to close #726 (#730)