App-rename
view release on metacpan or search on metacpan
bin/rename.PL view on Meta::CPAN
}
else {
print @_;
}
};
GetOptions(
'b|backup' => \$opt_backup, # [make a backup of each existing destionation file]
'c|copy' => \$opt_copy, # [copy files instead of rename]
'C|cmd|command=s' => \$opt_command, # [specify command to use instead of rename]
'B|prefix=s' => \$opt_prefix, # [set backup filename prefix]:backup filename prefix
'f|force' => \$opt_force, # [do not prompt before overwriting]
'g|git' => sub { $opt_command = 'git mv' }, # [use git to move files instead of rename]
'h|help' => \$opt_help, # -[display help and exit]
'i|interactive' => \$opt_interactive, # [prompt before overwrite]
'l|link-only' => \$opt_linkonly, # [hard link files instead of rename]
'n|just-print|dry-run' => \$opt_dryrun, # [don't rename, implies --verbose]
's|stdin!' => \$opt_stdin, # [read filenames from standard input]
'version' => \$opt_version, # -[output version information and exit]
'v|verbose' => \$opt_verbose, # [explain what is being done]
'V|version-control=s' => \$opt_vcm, # [set backup method]:backup method:(({none,off}\:never\ make\ backups\ \(even\ if\ --backup\ is\ given\) {numbered,t}\:make\ numbered\ backups {existing,nil}\:numbered\ if\ numbered\ backups\ exist,\ sim...
'Y|basename-prefix=s' => \$opt_basename_prefix, # [set backup file basename prefix]:backup basename prefix
'z|S|suffix=s' => \$opt_suffix, # [set backup filename suffix]:backup filename suffix
'shell-completion|shellcompletion=s' => \$opt_shellcompletion,
);
bin/rename.PL view on Meta::CPAN
if ($opt_help) {
print<<HELP;
Usage: $ME [OPTION]... PERLEXPR FILE...
Rename FILE(s) using PERLEXPR on each filename.
-b, --backup make backup before removal
-c, --copy copy file instead of rename
-C, --commmand=COMMAND use COMMAND instead of rename
-B, --prefix=SUFFIX set backup filename prefix
-f, --force remove existing destinations, never prompt
-g, --git use 'git mv' instead of rename
-i, --interactive prompt before overwrite
-l, --link-only link file instead of rename
-n, --just-print, --dry-run don't rename, implies --verbose
-v, --verbose explain what is being done
-V, --version-control=METHOD override the usual version control
-Y, --basename-prefix=PREFIX set backup filename basename prefix
-z, -S, --suffix=SUFFIX set backup filename suffix
--help display this help and exit
--version output version information and exit
The backup suffix is ~, unless set with SIMPLE_BACKUP_SUFFIX. The
bin/rename.PL view on Meta::CPAN
=head1 DESCRIPTION
I<rename> renames the filenames supplied according to the rule specified as
the first argument. The argument is a Perl expression which is expected to
modify the $_ string for at least some of the filenames specified. If a
given filename is not modified by the expression, it will not be renamed.
If no filenames are given on the command line, filenames will be read via
standard input (unless B<--no-stdin> is supplied on the command line).
If a destination file is unwritable, the standard input is a tty, and the
B<-f> or B<--force> option is not given, rename prompts the user for whether
to overwrite the file. If the response does not begin with `y' or `Y', the
file is skipped.
=head1 OPTIONS
=over 4
=item B<-b>, B<--backup>
Make backup files. That is, when about to overwrite a file, rename the
bin/rename.PL view on Meta::CPAN
=item B<-C> I<command>, B<--cmd> I<command>, B<--command> I<command>
Use I<command> to process files instead of rename. I<command> can
contain two instances of {}, the first will be replaced with the
original filename, the second with the new. Without any {}'s, the old
and new filename will be appended to the I<command>.
=item B<-f>, B<--force>
Remove existing destination files and never prompt the user.
=item B<-g>, B<--git>
Shortcut for B<--command "git mv">.
=item B<-h>, B<--help>
Print a summary of options and exit.
=item B<--no-stdin>
( run in 0.712 second using v1.01-cache-2.11-cpan-6aa56a78535 )