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