specify max tag depth (default: 15)
[id3fs.git] / sbin / id3fsd
index 983eafe..b46706a 100755 (executable)
@@ -10,16 +10,18 @@ use ID3FS::Fuse;
 use vars qw($me);
 $me=($0=~/(?:.*\/)?(.*)/)[0];
 
+our $VERSION="1.00";
 my $verbose=0;
 my $help=0;
 my $dbpath=undef;
+my $tagdepth=undef;
 
 Configure(qw(bundling no_ignore_case));
 my $optret=GetOptions(
-    "verbose|v"    => \$verbose,
-    "quiet|q"      => sub { $verbose=0; },
+    "verbose|v"    => sub { $verbose++; },
     "help|h"       => \$help,
     "database|f=s" => \$dbpath,
+    "t|tagdepth=s" => \$tagdepth,
     );
 
 usage() if(scalar(@ARGV) != 2 || !$optret || $help);
@@ -27,15 +29,16 @@ usage() if(scalar(@ARGV) != 2 || !$optret || $help);
 my $source=shift;
 my $mountpoint=shift;
 
-my $db=ID3FS::DB->new($me, $dbpath, $source);
-my $fuse=ID3FS::Fuse->new($db, $source, $mountpoint, $verbose);
+my $db=ID3FS::DB->new($me, $verbose, 0, $dbpath, $source);
+exit unless($db);
+
+my $fuse=ID3FS::Fuse->new($db, $source, $mountpoint, $verbose, $tagdepth);
 $fuse->run();
 
 sub usage
 {
     die("Usage: $me [-vqh] [-f <dbfile>] [--] <sourcedir> <mountpoint>\n".
-       " -v\t\t\tVerbose\n".
-       " -q\t\t\tQuiet (default)\n".
+       " -v\t\t\tVerbose (repeat for more verbosity)\n".
        " -h\t\t\tThis help\n".
        " -f|--database=FILE\tPath to database file\n" .
        " --\t\t\tEnd of options\n");
@@ -49,7 +52,7 @@ id3fsd - FUSE filesystem for browsing id3 tags
 
 =head1 SYNOPSIS
 
-B<id3fsd> [B<-vqh>] S<B<[-f >I<dbfile>]> [B<-->] I<SOURCEDIR> I<MOUNTPOINT>
+B<id3fsd> [B<-vh>] S<B<[-f >I<dbfile>]> [B<-->] I<SOURCEDIR> I<MOUNTPOINT>
 
 =head1 DESCRIPTION
 
@@ -73,11 +76,7 @@ FIXME: better description, allow_others/fuse.conf, fstab, explain genre tag
 
 =item B<-v>
 
-Enable verbose operation.
-
-=item B<-q>
-
-Quiet (no output). This is the default.
+Enable verbose operation. Repeat for more verbosity.
 
 =item B<-h>