fix pruning tags + only prune files/dirs under @ARGV
[id3fs.git] / bin / id3fs-index
index 631bd63..4ee56e5 100755 (executable)
@@ -16,6 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+use lib '/home/ianb/projects/id3fs/id3fs/lib'; # FIXME: remove
 use strict;
 use Getopt::Long qw(Configure);
 use ID3FS::DB;
@@ -74,7 +75,7 @@ else
     $db->last_update(time());
     my $base=$db->base_dir();
     my $abs_base=Cwd::abs_path($base);
-    while(my $path=shift)
+    for my $path (@ARGV)
     {
        if(Cwd::abs_path($path) !~ /^$abs_base/)
        {
@@ -82,7 +83,7 @@ else
        }
        File::Find::find( {wanted => \&wanted, follow => 1, no_chdir => 1}, $path);
     }
-    my $directories_pruned=$db->prune_directories();
+    my $directories_pruned=$db->prune_directories(@ARGV);
     if($files_pruned || $directories_pruned)
     {
        print "$me: pruning removed files from db\n" if $verbose;