rena is a tiny file/directory renaming command.
I hate a file name that has whitespace.
Sometimes, it occurs a bug of program (Especially, shell script).
Renaming is boring and takes times.
So I created rena
command. This will resolve this problem.
Nim 1.0.6
You can do dry-run
with -d
or --dry-run
.
It means that you can check file name before real renaming with your eyes.
Files or directories will be renamed if you didn't use -d
options.
replace
sub-command runs replacing characters, --from-str
to --to-str
.
replace
replaces whitespace in default.
This code runs dry-run.
$ rena replace --dry-run -t _ target_dir
# or
$ rena replace -d -t _ target_dir
This code actually runs renaming.
$ rena replace -t _ target_dir
# '-p' prints results
$ rena replace -p -t _ target_dir
You should use the --from-strs
or -f
options if you want to replace multiple characters.
Examples: Replacing (
and )
to _
.
$ rena replace -f '(' -f ')' -t "_" target_dir
You should use the delete
sub-command if you want to delete characters.
delete
deletes whitespace in default.
$ rena delete target_dir
You should use -f
options if you change delete target characters.
$ rena delete -f '(' -f ')' target_dir
lower
sub-command renames all characters to lower character.
$ rena lower target_dir
upper
sub-command renames all characters to upper character.
$ rena upper target_dir
nimble install rena
Download binary from Release.
MIT