2 # Ian Beckwith <ianb@erislabs.net>
5 use lib '/home/ianb/projects/id3fs/id3fs/lib';
7 use Getopt::Long qw(Configure);
11 $me=($0=~/(?:.*\/)?(.*)/)[0];
18 my @extensions=qw(mp3); # ogg flac); # FIXME
19 Configure(qw(bundling no_ignore_case));
20 my $optret=GetOptions(
21 "verbose|v" => \$verbose,
22 "quiet|q" => sub { $verbose=0; },
24 "basedir|d=s" => \$basedir,
25 "database|db=s" => \$dbpath,
26 "extensions|e=s" => sub { @extensions=split(/\s+|\s*,\s*/, $_[1]); },
29 usage() if(!@ARGV || !$optret || $help);
31 if(@ARGV > 1 && !defined($basedir))
33 die("$me: --basedir must be specified if multiple paths are supplied\n");
36 my $db=ID3FS::DB->new($me, $dbpath, $basedir, $ARGV[0]);
37 $db->last_update(time());
41 File::Find::find( {wanted => \&wanted, follow => 1, no_chdir => 1}, $path);
47 if(/.*\.(.*)/) { $ext=lc($1); }
50 print("$_\n") if $verbose;
52 elsif(-f && scalar(grep({ $ext eq lc($_);} @extensions)))
61 die("Usage: $me [-v] [-q] [-h] [--] file...\n".
63 " -q\tQuiet (default)\n".
65 " --\tEnd of options\n");
77 B<> [I<-v>] [I<-q>] [I<-h>] [I<file>...]
87 Enable verbose operation.
91 Quiet (no output). This is the default.
95 Show a short help message.
111 None known. Please report any found to ianb@erislabs.net
117 Ian Beckwith <ianb@erislabs.net>
121 The latest version can be found at:
123 B<http://erislabs.net/ianb/projects/id3fs/>
127 Copyright 2010 Ian Beckwith <ianb@erislabs.net>
129 This program is free software: you can redistribute it and/or modify
130 it under the terms of the GNU General Public License as published by
131 the Free Software Foundation; either version 3 of the License, or
132 (at your option) any later version.
134 This program is distributed in the hope that it will be useful,
135 but WITHOUT ANY WARRANTY; without even the implied warranty of
136 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
137 GNU General Public License for more details.
139 You should have received a copy of the GNU General Public License
140 along with this program. If not, see <http://www.gnu.org/licenses/>.