]> Sergey Matveev's repositories - torn.git/blobdiff - torn
FORCE_DIR ability
[torn.git] / torn
diff --git a/torn b/torn
index b85b2697e33a5904abfe3d1cf5c52163c5b84a14..36d8c8f10bee2e2b0eda96a315866f68481711db 100755 (executable)
--- a/torn
+++ b/torn
@@ -25,7 +25,8 @@ files and rules to convert russian filenames to translit.
 =head1 USAGE
 
 Simply run this script in directory where you want files and/or
-directorires to be renamed.
+directories to be renamed. Directories are not transliterated by
+default, but you can use FORCE_DIR=1 environment variable.
 
 =head1 OVERVIEW
 
@@ -66,7 +67,7 @@ my $dst;
 my $src_filename;
 
 if ($#ARGV >= 0) {
-    print "torn version $VERSION, Copyright (C) 2007-2020 Sergey Matveev
+    print "torn version $VERSION, Copyright (C) 2007-2021 Sergey Matveev
 torn comes with ABSOLUTELY NO WARRANTY.  This is free software,
 and you are welcome to redistribute it under certain conditions.\n
 Usage: just run inside the directory. Look for POD inside the script itself.\n";
@@ -76,7 +77,7 @@ opendir DIR, "." or die "Can not open directory\n";
 foreach (sort readdir DIR) {
     # Skip directory itself
     next if /^\.{1,2}$/;
-    next if -d;
+    next if -d and not $ENV{FORCE_DIR};
 
     $src_filename = $_;
     $src = decode "utf-8", $src_filename;