Skip to content

Commit

Permalink
Update README.md with the new program features
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadiguibou committed Jul 13, 2020
1 parent 9336a3e commit 15893f4
Showing 1 changed file with 43 additions and 1 deletion.
44 changes: 43 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 15893f4

Please sign in to comment.