Skip to content

Support for extension filter

Latest

Choose a tag to compare

@foiovituh foiovituh released this 06 Jul 17:55
· 2 commits to main since this release

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:

./mfr -d=/home/you/test/
  • Before:
/home/you/test/
├── text.txt
├── image.png
├── document.pdf
└── program.java
  • After:
/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
  • Before:
/home/you/test/
├── text.txt
├── image.png
├── other-image.png
├── document.pdf
└── program.java
  • After:
/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