:main:README
Rename File Set
Rename File Set is a utility for transforming the name of matching files using the full power of regular expressions. I originally created this program to help organize my mp3 collection, but it has proven to be generally useful.
As I have added features, the program has been extesively refactored. It is DRY and very modular. It is also very well tested. Features can now be added or changed very easily.
- Author
-
Darrick Wiebe
- Copyright
-
Copyright © 2005 Darrick Wiebe
- License
-
Distributed under the MIT Licence (see MIT-LICENCE file)
Command Line Interface
There are two entry points to the command line version of the program. The primary one is rfs.rb
. rfsd.rb
just adds debugging options.
Usage
rfs.rb [] [path] [path] ...
If no path is specified, the current directory is used.
The Four Primary Modes of Operation
--list
-
List Mode: List all files in the folder
--match
-
Match Mode: List all matching files but don’t make any changes
--test
-
Testing Mode: Display the results without making any changes
--commit
-
Commit Mode: Actually perform the operation on the target files and display the results. By default,
--confirm
is turned on, see below.
Search
--search
regular expression-
This option is required for
Behaviour Modification Options
--confirm
-
Ask for confirmation before committing a change with a prompt like:
"./original" => "new_name"? [Yes/No/All/Cancel] (yes) _
or
"./original" => existing file "new_name"? [Yes/No/All/Cancel] (yes) _
This option is on by default.
--noconfirm
-
Don’t confirm changes.
--capture
capture number-
Specifies which capture in the regular expression should be used or replaced. By default the first capture is used. This option affects all regular expressions used. If the expression has no captures, the whole match is used, and this setting has no effect.
--filter
regular expression-
Filters out all matching files or directories. Multiple filters may be specified.
--keep
regular expression-
Filters out all non-matching files or directories. Multiple filters may be specified.
--force
-
Overwrite existing files. If
--confirm
is on, the confirmation message will --ignorecase
-
Make all regular expressions case-insensitive.
--recursive
-
Recursively descend into the paths specified.
--reverse
-
Iterates through files in reverse order.
Primary Functions
--add
number-
Add
number
tothe capture
. --count
start-
Replace
the capture
with the count.succ
is used to increment, so you can use either letters or numbers. --
--
--
--
--
--
-
Display Options
--
--
--
--
-
The program