]> Sergey Matveev's repositories - torn.git/blobdiff - torn
Trivial formatting
[torn.git] / torn
diff --git a/torn b/torn
index 9243e8c76d5bd66932adc0bc1d6e3dfecf1609d7..e1f1cfc0d5eeacaae75bcb55e37a79ee13d30410 100755 (executable)
--- a/torn
+++ b/torn
@@ -10,7 +10,7 @@
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
@@ -65,14 +65,18 @@ my $src;
 my $dst;
 my $src_filename;
 
-print "torn version $VERSION, Copyright (C) 2007-2020 Sergey Matveev
+if ($#ARGV >= 0) {
+    print "torn version $VERSION, Copyright (C) 2007-2020 Sergey Matveev
 torn comes with ABSOLUTELY NO WARRANTY.  This is free software,
-and you are welcome to redistribute it under certain conditions.\n\n";
+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";
+};
 
 opendir DIR, "." or die "Can not open directory\n";
 foreach (sort readdir DIR) {
     # Skip directory itself
     next if /^\.{1,2}$/;
+    next if -d;
 
     $src_filename = $_;
     $src = decode "utf-8", $src_filename;
@@ -108,7 +112,7 @@ foreach (sort readdir DIR) {
     $dst =~ s/Ю/Ju/g;
 
     # Lowercase file extensions
-    if($dst =~ /^(.*)\.([^\.]+)$/){
+    if ($dst =~ /^(.*)\.([^\.]+)$/) {
         $dst = $1 . "." . lc $2;
     };