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