pathcify
Rust CLI tool to recursively slugify file and directory names using dots, removing special characters and normalizing names.
Available on crates.io.
For examples:
La Quête d'Ewilan vol.1 : D'un monde à l'autre-·/_,:; (1), [Bottero, Pierre]Author@{1} <book> ?!//&tola.quete.dewilan.vol.1.dun.monde.a.lautre-._.1.bottero.pierre.author.{1}.bookwith lowercase00 - Préfaceto00-PrefaceGóðan daginntoGodan.Daginn
Requirements
Installation
You can install pathcify with Cargo.
Usage
You can execute pathcify on a directory or a file:
All files and directories will be recursively pathcified, converting their names to a format suitable for URLs or filenames.
- Remove all special characters
- Replace all spaces with a dot
- Remove all dots at the beginning and the end of the string
- Replace all dots that are repeated more than once with a single dot
- Keep
-and_characters (and remove spaces before and after them) - Full lowercase with option
-l
Options
-l,--lowercase: Convert all names to lowercase.-h,--help: Print help information.-V,--version: Print the version of the tool.
Build and publish
Build and test the package:
Test publishing:
Publish the package to crates.io:
License
This project is licensed under the MIT License - see the LICENSE file for details.