sreplace 0.9.4

Command line program utility to replace strings in files.
# sreplace

Command line program to replace strings in files.

Quickly replace strings in a directory text files!

This is a rewritting of an [old project of mine](https://sourceforge.net/projects/sreplace/), from C++ to rust.

## Installation

1. [install rust]https://www.rust-lang.org/tools/install
1. install `sreplace` using `cargo`:
```sh
cargo install sreplace
```

The ready to use executable command is `sr`.

## Usage

```html
Search for a pattern in a file and replace it by a string. Support UTF-8 encoding

Usage: sr [OPTIONS] <PATTERN> <REPLACEMENT> <PATH>

Arguments:
  <PATTERN>      The pattern to look for, string by default, may be a regular expression
  <REPLACEMENT>  The replacement string
  <PATH>         The path to the file or directory

Options:
  -e, --regex                  Search pattern as a regular expression (slower)
  -i, --case-insensitive       Case insensitive search
  -t, --extension <EXTENSION>  Replace only the files with the specified extension
  -L, --follow-symlink         Follow symbolic links
  -d, --dry-run                Do not modify any file, just print what would happen
  -v, --verbose...             More output per occurrence
  -q, --quiet...               Less output per occurrence
  -h, --help                   Print help
```

## Examples

### Replace in regular file
![Replace in regular file](/doc/sr-regular.gif "sr hello bonjour hello.txt")

### Replace recursively in folder
![Replace in folder](/doc/sr-folder.gif "sr --dry-run hello bonjour .")

## Features

* UTF-8 encoding support
* Support regular expression searched patterns
* Support case insensitive searched patterns
* Recursively browse directories
* Filter on regular files extensions

## License

GPL v3