Skip to content

docs: collapsible, verified usage examples - #15

Merged
capjan merged 5 commits into
mainfrom
feat/replace-dry-run-diff
Sep 25, 2026
Merged

capjan merged 5 commits into
mainfrom
feat/replace-dry-run-diff

Conversation

@capjan

@capjan capjan commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • README: the usage examples are now collapsible <details> blocks. Each one is a self-contained walkthrough with the starting files, the command and the exact output.
  • Covered: recursive search with --filter, --case-sensitive, --only-matching / --max-count, replace with a named group, --dry-run, and --diff followed by patch.
  • All outputs were taken from real runs of the built tool, not written by hand.
  • Kept from main: the --diff … (implies --dry-run) option text and the patch -p0 / git apply -p0 note.

The --dry-run / --diff feature itself is already on main; this PR only touches README.md.

Test plan

  • CI is green (dotnet test, 55 tests pass locally)
  • README renders correctly on GitHub and every block expands

--dry-run reports the replacements that would be made, --diff prints
them as unified diff. Neither writes a file. Both require --replace.
… clean patch

- A match that leaves the text unchanged (e.g. foo -> foo) produced an
  empty diff, and PrintDiff threw ArgumentOutOfRangeException on it.
- With -v, the 'Progressing' and per-match lines went to stdout and
  corrupted the patch. With --diff they now go to stderr.
- Help text and README: --diff replaces the summary and implies --dry-run.
- README: git apply -p0 works with relative paths.
- Tests: -n with -d, several files, file without trailing newline.
@capjan capjan changed the title feat: add --dry-run and --diff for --replace docs: collapsible, verified usage examples Sep 25, 2026
@capjan
capjan merged commit 986a30f into main Sep 25, 2026
3 checks passed
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.

1 participant