da5f7df7161f38ff28e7e4a7b1791dd31b6ee2ea
[id3fs.git] / sbin / id3fsd
1 #!/usr/bin/perl -w
2 # Ian Beckwith <ianb@erislabs.net>
3 #
4
5 use lib '/home/ianb/projects/id3fs/id3fs/lib';
6 use strict;
7 use Getopt::Long qw(Configure);
8 use ID3FS::DB;
9 use ID3FS::Fuse;
10 use vars qw($me);
11 $me=($0=~/(?:.*\/)?(.*)/)[0];
12
13 my $verbose=0;
14 my $help=0;
15
16 Configure(qw(bundling no_ignore_case));
17 my $optret=GetOptions(
18     "verbose|v"  => \$verbose,
19     "quiet|q"    => sub { $verbose=0; },
20     "help|h"     => \$help,
21     );
22
23 usage() if(scalar(@ARGV) != 2 || !$optret || $help);
24
25 my $source=shift;
26 my $mountpoint=shift;
27
28 my $db=ID3FS::DB->new($source, 0, $me);
29 my $fuse=ID3FS::Fuse->new($db, $source, $mountpoint);
30 $fuse->run();
31
32 sub usage
33 {
34     die("Usage: $me [-v] [-q] [-h] [--] file...\n".
35         " -v\tVerbose\n".
36         " -q\tQuiet (default)\n".
37         " -h\tThis help\n".
38         " --\tEnd of options\n");
39 }
40
41 __END__
42
43 =head1 NAME
44
45 program - description
46
47 =head1 SYNOPSIS
48
49 B<> [I<-v>] [I<-q>] [I<-h>] [I<file>...]
50
51 =head1 DESCRIPTION
52
53 =head1 OPTIONS
54
55 =over 4
56
57 =item B<-v>
58
59 Enable verbose operation.
60
61 =item B<-q>
62
63 Quiet (no output). This is the default.
64
65 =item B<-h>
66
67 Show a short help message.
68
69 =item B<-->
70
71 End of options.
72
73 =back
74
75 =head1 FILES
76
77 =head1 ENVIRONMENT
78
79 =head1 DIAGNOSTICS
80
81 =head1 BUGS
82
83 None known. Please report any found to ianb@erislabs.net
84
85 =head1 SEE ALSO
86
87 =head1 AUTHOR
88
89 Ian Beckwith <ianb@erislabs.net>
90
91 =head1 AVAILABILITY
92
93 The latest version can be found at:
94
95 B<http://erislabs.net/ianb/projects/id3fs/>
96
97 =head1 COPYRIGHT
98
99 Copyright 2010 Ian Beckwith <ianb@erislabs.net>
100
101 This program is free software: you can redistribute it and/or modify
102 it under the terms of the GNU General Public License as published by
103 the Free Software Foundation; either version 3 of the License, or
104 (at your option) any later version.
105
106 This program is distributed in the hope that it will be useful,
107 but WITHOUT ANY WARRANTY; without even the implied warranty of
108 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
109 GNU General Public License for more details.
110
111 You should have received a copy of the GNU General Public License
112 along with this program.  If not, see <http://www.gnu.org/licenses/>.
113
114 =cut