Skip to content

Commit

Permalink
Add example of ignoring file extension
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoisaiah committed Feb 24, 2021
1 parent c944ef1 commit 3b44dce
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- [Basic find and replace](#basic-find-and-replace)
- [Recursive find and replace](#recursive-find-and-replace)
- [Include directories](#include-directories)
- [Ignore extensions](#ignore-extensions)
- [Strip out unwanted text](#strip-out-unwanted-text)
- [Rename using an auto incrementing number](#rename-using-an-auto-incrementing-number)
- [Replace spaces with underscores](#replace-spaces-with-underscores)
Expand Down Expand Up @@ -242,6 +243,25 @@ $ f2 -f 'pic' -r 'image' -D -x
└── pic-03.avif
```

### Ignore extensions

The file extension is matched by default. If this behaviour is not desired, use
the `--ignore-ext` or `-e` flag:

```bash
$ ls
a-jpeg-file.jpeg file.jpeg
```

```bash
$ f2 -f "jpeg" -r "jpg" -e
+------------------+-----------------+--------+
| INPUT | OUTPUT | STATUS |
+------------------+-----------------+--------+
| a-jpeg-file.jpeg | a-jpg-file.jpeg | ok |
+------------------+-----------------+--------+
```

### Strip out unwanted text

You can strip out text by leaving out the `-r` flag. It defaults to an empty string:
Expand Down

0 comments on commit 3b44dce

Please sign in to comment.