Add README.md and LICENSE.

This commit is contained in:
Pedro de Oliveira 2023-05-07 20:18:13 +01:00
parent d25f467665
commit 6c6fb31b7b
3 changed files with 71 additions and 3 deletions

View File

@ -3,10 +3,10 @@ name = "rmv"
version = "0.1.0"
edition = "2021"
authors = ["Pedro de Oliveira <falsovsky@gmail.com>"]
license = "MIT"
license = "WTFPL"
description = "rmv: Renaming made easy with regex"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
readme = "README.md"
repository = "https://git.deadbsd.org/falso/rmv"
[dependencies]
clap = { version = "4.2.7", features = ["derive"] }

13
LICENSE Normal file
View File

@ -0,0 +1,13 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

55
README.md Normal file
View File

@ -0,0 +1,55 @@
# rmv: Renaming made easy with regex
`rmv` is a command-line tool that allows you to rename files in a directory using regular expressions. You can use it to match patterns in filenames and replace them with new patterns.
## Installation
To install `rmv`, run the following command:
```sh
cargo install --git https://git.deadbsd.org/falso/rmv.git
```
## Usage
To use `rmv`, you need to specify the path to the directory where the files to be renamed are located, a regular expression pattern to match against the filenames, and a replacement pattern for the matched filenames.
Here is an example usage:
```shell
$ rmv --path /path/to/files --pattern "S(\d+)E(\d+).*\.(...)" --replacement "Season \1 Episode \2.\3" --wildcard "*.mkv"
```
This will match all filenames in the directory that match the pattern `"S(\d+)E(\d+).*.(...)"` and replace them with the pattern `"Season \1 Episode \2.\3"`. Only files with the `".mkv"` extension will be considered.
### Options
Here are the available options:
```sh
-i, --path <PATH>
Path to the directory where the files to be renamed are located
-s, --pattern <PATTERN>
Regular expression pattern to match against the filenames in the directory.
The pattern should contain match groups (expressed in parentheses). Example: "s(\d+)e(\d+).*\.(...)"
-r, --replacement <REPLACEMENT>
Replacement pattern for the matched filenames.
You can use `\1`, `\2`, etc. to reference the match groups in the pattern. Example: "Season \1 Episode \2.\3"
-w, --wildcard <WILDCARD>
Filename wildcard to filter the files to be renamed in the directory.
Use `*` to match any filename. For example, "*.mkv" will match all files with the ".mkv" extension.
[default: *]
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
```
## License
This tool is licensed under the WTFPL license. See the LICENSE file for details.