bzr-rxrenames
Eduardo O. Padoan
eduardo.padoan at gmail.com
Fri Feb 20 12:35:55 GMT 2009
Hi,
Some days ago I have written my first bzr plugin, to rename multiple
files using a regexp. I hope that it can be useful to someone.
As it is my first plugin, I'm not sure that I'm using the must
appropriated API to collect the file names. I'd be very glad If some
could do a quick review of it, thanks!
I'm also accepting suggestions on a better name: rxrename is taken by
some perl tool :(
Purpose: Renames files using a regular expression.
Usage: bzr rxrename EXPRESSION REPLACEMENT [LOCATION]
Options:
-v, --verbose Display more information.
-q, --quiet Only display errors and warnings.
--no-prompt Dont ask for confirmation before renaming.
-h, --help Show help message.
Description:
Renames files that match the given EXPRESSION, a regexp.
Substitutes matches of EXPRESSION on each filename with
REPLACEMENT:
$ bzr rxrename "^(test)([a-z0-9]*)" "\1_\2"
This will rename files like "testfoo1.py" to "test_foo1.py".
The optional LOCATION is the current directory by default.
Aliases: subs
From: plugin "rxrenames"
https://code.edge.launchpad.net/bzr-rxrename
--
Eduardo de Oliveira Padoan
http://importskynet.blogspot.com
http://djangopeople.net/edcrypt/
"Distrust those in whom the desire to punish is strong."
-- Goethe, Nietzsche, Dostoevsky
More information about the bazaar
mailing list