Skip to content

Warn that --output-match skips the --js code to close #797 - #801

Merged
mathiasrw merged 1 commit into
mainfrom
fix/797
Oct 23, 2026
Merged

mathiasrw merged 1 commit into
mainfrom
fix/797

Conversation

@mathiasrw

Copy link
Copy Markdown
Owner

Closes #797

Stacked on #800.

Change

With --output-match only the matches are printed, so the replacement is not used, and the code of --js (or --js-pipe) is not run. That now gives a warning:

> rexreplace 'o' 'console.log("hi")' my.file --js --output-match
o
o
 🟡 The code is not run with --output-match, as only the matches are printed.
  • The run goes on as before, and --quiet hides the warning, like the other warnings.
  • The help and the README for --output-match say so too.

Tests

yarn test-ci passes: the demo on Node and Bun, and 976 Bun tests. The test for --js with --output-match checks the warning, and that --quiet hides it.

@mathiasrw
mathiasrw added this pull request to stack #787 October 23, 2026 09:45
Base automatically changed from fix/794 to main October 23, 2026 10:06
@mathiasrw mathiasrw changed the title Warn when --js code is not run with --output-match to close #797 Warn that --output-match skips the --js code to close #797 Oct 23, 2026
@mathiasrw
mathiasrw merged commit 22bd6bb into main Oct 23, 2026
7 checks passed
@mathiasrw
mathiasrw deleted the fix/797 branch October 23, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warn that --output-match skips the --js code

1 participant