[Templates-svn] r1075 - trunk/bin

svn@template-toolkit.org svn@template-toolkit.org


Author: abw
Date: 2007-05-04 12:10:12 +0100 (Fri, 04 May 2007)
New Revision: 1075

Modified:
   trunk/bin/ttree
Log:
fixed --accept option in ttree to match against complete paths like --ignore

Modified: trunk/bin/ttree
===================================================================
--- trunk/bin/ttree	2007-05-03 10:54:52 UTC (rev 1074)
+++ trunk/bin/ttree	2007-05-04 11:10:12 UTC (rev 1075)
@@ -251,6 +251,15 @@
                 next FILE;
             }
         }
+        
+        # check against acceptance list
+        if (@$accept) {
+            unless (grep { $path =~ /$_/ } @$accept) {
+                printf "  - %-32s (not accepted)\n", $path
+                    if $verbose;
+                next FILE;
+            }
+        }
 
         if (-d $abspath) {
             if ($recurse) {
@@ -368,15 +377,6 @@
         return;
     }
 
-    # check against acceptance list
-    if (@$accept) {
-        unless (grep { $filename =~ /$_/ } @$accept) {
-            printf "  - %-32s (not accepted)\n", $file
-                if $verbose;
-            return;
-        }
-    }
-
     if ($verbose) {
         printf("  + %-32s", $file);
         print " (changed suffix to $new_suffix)" if $new_suffix;