Changes 💡
- Extension filter support added
- Now command line arguments are managed using the "flag" library
Quick usage guide 📚
Arguments:
-d=string
[REQUIRED] Full directory path to rename all files
-e=string
[OPTIONAL] Filter files containing the extension
-p=string
[OPTIONAL] Pattern to apply in the file renaming process (default "file-")
Basic usage example:
/home/you/test/
├── text.txt
├── image.png
├── document.pdf
└── program.java
/home/you/test/
├── file-1.txt
├── file-2.png
├── file-3.pdf
└── file-4.java
Example of pattern customization and extension filter:
./mfr -d=/home/you/test/ -p=photo -e=.png
/home/you/test/
├── text.txt
├── image.png
├── other-image.png
├── document.pdf
└── program.java
/home/you/test/
├── text.txt
├── photo-1.png
├── photo-2.png
├── document.pdf
└── program.java
Future plans 📌
- Write more tests
- Allow customized sorting
- Create a backup of the renamed files
- Ask for confirmation in important directories