sort out DB new interface; search in parent dirs for .id3fs
[id3fs.git] / bin / id3fs-index
index 9493f7c..132d81e 100755 (executable)
@@ -15,6 +15,7 @@ my $help=0;
 my $basedir=undef;
 my $dbpath=undef;
 my $list=0;
+my $init=0;
 my @extensions=qw(mp3 flac ogg);
 my $files_pruned;
 
@@ -30,13 +31,16 @@ my $optret=GetOptions(
     );
 
 usage() if(!@ARGV || !$optret || $help);
+$init=1 unless($list);
 
 if(@ARGV > 1 && !defined($basedir))
 {
     die("$me: --basedir must be specified if multiple paths are supplied\n");
 }
 
-my $db=ID3FS::DB->new($me, $dbpath, $basedir, $ARGV[0]);
+my $db=ID3FS::DB->new($me, $verbose, $init, $dbpath, $basedir, $ARGV[0]);
+exit unless($db);
+
 if($list)
 {
     list_tags($db);
@@ -97,9 +101,6 @@ sub prune
     }
 }
 
-
-
-
 sub list_tags
 {
     my($db)=@_;