From 15893f4913a509debb0c8215b94a050e6f670531 Mon Sep 17 00:00:00 2001 From: Gabriel Lacroix Date: Mon, 13 Jul 2020 10:07:51 -0400 Subject: [PATCH] Update README.md with the new program features --- README.md | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 60e9cf1..c42b5eb 100644 --- a/README.md +++ b/README.md @@ -51,14 +51,56 @@ Then, just type the path to the file: By default, the program will rename all files in the current directory with the default convention (kebab-case). +### Specifying a different naming convention + You can specify a different naming convention with the first argument you pass to the program e.g.: ```bash ./stdrename snake_case ``` -You can also specify another folder to parse with a second argument e.g.: +### Specifying a different folder to parse + +You can also specify a different folder to parse with a second argument e.g.: ```bash ./stdrename camelCase ~/Pictures ``` + +### Renaming files in subfolders as well + +To rename recursively, use the flag `-r` as the third argument e.g.: + +```bash +./stdrename kebab-case ./new-dir/ -r +``` + +### Ignoring files and subdirectories + +Finally, you may add a .ignore file with patterns to ignore in the file's directory and its subdirectories. + +This file may use any of the glob patterns that can be used in a `.gitignore` file. It is functionally the same, just with a different name e.g.: + +Adding the following line in a new .ignore file in the same directory as stdrename will ignore all files with the extension `.py` and all files in the subdirectory `./target/`. + +```ignore +# ./.ignore +# ignore all files ending with .py +# ignore all files in /target and its subdirectories + +*.py +/target +``` + +You may even add a second .ignore file in a subdirectory e.g.: + +```ignore +# ./subdir1/.ignore +# match .py files despite previous instructions +# ignore .txt files in this directory and all subdirectories + +!*.py +*.txt +``` + +All files in that directory and all sub directories will then reinclude .py files and ignore .txt files.