opts.dry_run = false
opts.num_digits = 2
opts.extension = nil
+ opts.starting_number = 1
$fu_args = { :verbose => true }
opts.preserve_names = false
"Preserve the names while changing the numbers.") do |e|
opts.preserve_names = true
end
+ myparser.on("--starting-number NUMBER", "-N",
+ "The starting number (defaults to 1)") do |e|
+ opts.starting_number = e.to_i
+ end
end
parser.parse!(args)
end
def rename_files(file)
- dst="#{get_file_name(1 + $total_files)}.#{$opts.extension}"
+ dst="#{get_file_name($opts.starting_number + $total_files)}.#{$opts.extension}"
if (file != dst) then
FileUtils.mv(file, dst, $fu_args)
end