diff --git a/Cargo.toml b/Cargo.toml index a5bd530..2199756 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,10 +3,10 @@ name = "rmv" version = "0.1.0" edition = "2021" authors = ["Pedro de Oliveira "] -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"] } diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..07b7a81 --- /dev/null +++ b/LICENSE @@ -0,0 +1,13 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + +Copyright (C) 2004 Sam Hocevar + +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. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..651cbe9 --- /dev/null +++ b/README.md @@ -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 to the directory where the files to be renamed are located + +-s, --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 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 + 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. \ No newline at end of file