id3fs-tag: don't print filename on tags line
[id3fs.git] / sbin / id3fsd
index 0809985..9333c78 100755 (executable)
 # 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';
+use lib '/home/ianb/projects/id3fs/id3fs/lib'; # FIXME: remove
 use strict;
 use Getopt::Long qw(Configure);
 use ID3FS::DB;
 use ID3FS::Fuse;
+use POSIX;
+
 use vars qw($me);
 $me=($0=~/(?:.*\/)?(.*)/)[0];
 
@@ -48,12 +50,28 @@ my $db=ID3FS::DB->new($me, $verbose, 0, $source, $dbpath);
 exit unless($db);
 
 my $fuse=ID3FS::Fuse->new($db, $source, $mountpoint, $verbose, $tagdepth);
+
+# disassociate from terminal
+unless($verbose)
+{
+    my $pid=fork();
+    if(defined($pid))
+    {
+       exit if($pid);   # parent
+       POSIX::setsid(); # child
+    }
+    else
+    {
+       print "$me: couldn't drop terminal: $!\n";
+    }
+}
+
 $fuse->run();
 
 sub usage
 {
     die("Usage: $me [-vh] [-f <dbfile>] [-t <tagdepth>] [--] <sourcedir> <mountpoint>\n".
-       " -t|--tagdepth=NUM\tMaximum number of tags in expression (default: 10)\n" .
+       " -t|--tagdepth=NUM\tMaximum number of tags in expression (default: 6)\n" .
        " -f|--database=FILE\tPath to database file\n" .
        " -v\t\t\tVerbose (repeat for more verbosity)\n".
        " -h\t\t\tThis help\n".
@@ -122,7 +140,7 @@ Directory to mount the id3fs view of the files.
 Maximum number of tags in an expression. A query with many ANDs and
 NOTs can get quite slow. This option allows a cutoff before things get
 too slow, as well as providing some eventual limit when processes
-recurse into the filesystem. The default is 10.
+recurse into the filesystem. The default is 6.
 
 =item S<B<-f >I<FILE>> | S<B<--database=>I<FILE>>
 
@@ -160,6 +178,10 @@ Example paths:
   /krautrock/AND/year/1971/NOARTIST/unknown-track.mp3
   /krautrock/AND/year/1971/TRACKS/01-Paperhouse.mp3
 
+id3fs supports OR, AND and NOT. NOT has the highest precedence,
+followed by AND, so F<foo/OR/NOT/bar/AND/baz> is parsed as
+(foo OR ((NOT bar) AND baz)).
+
 =head2 Tags
 
 Tags are extracted from the B<genre> tag of audio files with
@@ -168,37 +190,13 @@ L<id3fs-index(1)>.
 Within the genre frame/comment, tags are separated by commas.
 
 Tags can have values, separated by a slash, eg I<metal/thrash>,
-I<rating/5>. Certain tags are automatically filled in from other file
-metadata, see L</"Special Tags>.
-
-=head2 Special Directories
-
-=over 4
-
-=item B<ALL>
-
-This is a special directory in the root of the filesystem, that
-provides access to all the indexed files, regardless of tags assigned.
-
-=item B<TRACKS>
-
-All tracks that match the given tag expression, whether they have an
-assigned artist and album or not.
-
-=item B<NOARTIST>
-
-Tracks matching the given expression that do not have an artist tag.
-
-=item B<NOALBUM>
-
-Tracks matching the given expression that do not have an album tag.
-
-=back
+I<rating/5>. Certain special tags are automatically filled in from
+other file metadata.
 
 =head2 Special Tags
 
-Several tags are automatically derived from other metadata in the
-audio files:
+The following tags are automatically derived from other metadata in
+the audio files:
 
 =over 4
 
@@ -223,6 +221,30 @@ Type of audio file (mp3, ogg, flac). Always set.
 
 =back
 
+=head2 Special Directories
+
+=over 4
+
+=item B<TRACKS>
+
+All tracks that match the given tag expression, whether they have an
+assigned artist and album or not.
+
+=item B<NOARTIST>
+
+Tracks matching the given expression that do not have an artist tag.
+
+=item B<NOALBUM>
+
+Tracks matching the given expression that do not have an album tag.
+
+=item B<ALL>
+
+This is a special directory in the root of the filesystem, that
+provides access to all the indexed files, regardless of tags assigned.
+
+=back
+
 =head1 FUSE AND MOUNTING AUTOMATICALLY
 
 For others to be able to view your id3fs mount(s), you need to set the