| Crates.io | grepatch |
| lib.rs | grepatch |
| version | 0.1.0 |
| created_at | 2025-04-12 06:25:11.058308+00 |
| updated_at | 2025-04-12 06:25:11.058308+00 |
| description | A command-line patch tool that processes grep output to apply text replacements to files |
| homepage | https://github.com/sile/grepatch |
| repository | https://github.com/sile/grepatch |
| max_upload_size | |
| id | 1630657 |
| size | 17,135 |
grepatch is a command-line patch tool that processes grep output to apply text replacements to files.
# Replace text using sed
$ git grep -n "old_text" | sed 's/old_text/new_text/g' | grepatch
# Edit matches manually in your preferred editor
$ git grep -n "function_name" | grepatch --edit
grepatch transforms the grep-formatted output (with line numbers) into file modifications. It's perfect for making consistent changes across multiple files in a codebase.
grep -n, git grep -n and similar tools$ cargo install grepatch
$ grepatch -h
A command-line patch tool that processes grep output to apply text replacements to files
Usage: grepatch [OPTIONS]
Options:
--version Print version
-h, --help Print help ('--help' for full help, '-h' for summary)
-e, --edit Edit the input patch before applying it to allow manual modifications
--editor <PATH> Specify which editor to use when '--edit' is enabled [env: EDITOR]
file_path:line_number:content