source: mp3-find/trunk/bin/mp3db @ 17

Last change on this file since 17 was 10, checked in by peter, 19 years ago
  • added test suite for the DB backend
  • doc corrections and updates to Find.pm and Base.pm
  • moved create and update database functions from mp3db to DB.pm
  • added "destroy_db" function to DB.pm
  • documented mp3db
  • set version to 0.02
File size: 1.3 KB
RevLine 
[1]1#!/usr/bin/perl -w
2use strict;
3
4use lib '/home/peter/projects/mp3-find/lib';
[10]5use MP3::Find::DB;
[1]6
7use File::Spec::Functions qw(catfile);
8use Getopt::Long;
9GetOptions(
[10]10    'create'   => \my $CREATE,
[1]11    'file|f=s' => \my $DB_FILE,
12);
13
14$DB_FILE ||= catfile($ENV{HOME}, 'mp3.db');
15
16my @DIRS = @ARGV;
17
[10]18my $f = MP3::Find::DB->new;
19$f->create_db($DB_FILE) if $CREATE;
20$f->update_db($DB_FILE, \@DIRS) if @DIRS;
[1]21
[10]22=head1 NAME
[1]23
[10]24mp3db - Frontend for creating and updating a database for MP3::Find::DB
[1]25
[10]26=head1 SYNOPSIS
[1]27
[10]28    # create the database file
29    $ mp3db --create --file my_mp3.db
[1]30   
[10]31    # add info
32    $ mp3db --file my_mp3.db ~/mp3
[1]33   
[10]34    # update, and add results from another directory
35    $ mp3db --file my_mp3.db ~/mp3 ~/cds
[1]36
[10]37=head1 DESCRIPTION
[1]38
[10]39    mp3db [options] [directory] [directories...]
[1]40
[10]41Creates and/or updates a database of ID3 data from the mp3s found
42in the given directories.
[1]43
[10]44=head2 Options
45
46=over
47
48=item C<--create>, C<-c>
49
50Create the database file named by the C<--file> option.
51
52=item C<--file>, C<-f>
53
54The name of the database file to work with. Defaults to F<~/mp3.db>.
55
56=back
57
58=head1 AUTHOR
59
60Peter Eichman <peichman@cpan.org>
61
62=head1 COPYRIGHT AND LICENSE
63
64Copyright (c) 2006 by Peter Eichman. All rights reserved.
65
66This program is free software; you can redistribute it and/or
67modify it under the same terms as Perl itself.
68
69=cut
Note: See TracBrowser for help on using the repository browser.