|
Last change
on this file since 27 was
23,
checked in by peter, 20 years ago
|
- removed hardcoded "use lib '/home/peter/projects/mp3-find/lib'" form distrubuted scripts
|
|
File size:
1.3 KB
|
| Line | |
|---|
| 1 | #!/usr/bin/perl -w |
|---|
| 2 | use strict; |
|---|
| 3 | |
|---|
| 4 | use MP3::Find::DB; |
|---|
| 5 | |
|---|
| 6 | use File::Spec::Functions qw(catfile); |
|---|
| 7 | use Getopt::Long; |
|---|
| 8 | GetOptions( |
|---|
| 9 | 'create' => \my $CREATE, |
|---|
| 10 | 'file|f=s' => \my $DB_FILE, |
|---|
| 11 | ); |
|---|
| 12 | |
|---|
| 13 | $DB_FILE ||= catfile($ENV{HOME}, 'mp3.db'); |
|---|
| 14 | |
|---|
| 15 | my @DIRS = @ARGV; |
|---|
| 16 | |
|---|
| 17 | my $f = MP3::Find::DB->new; |
|---|
| 18 | $f->create_db($DB_FILE) if $CREATE; |
|---|
| 19 | $f->update_db($DB_FILE, \@DIRS) if @DIRS; |
|---|
| 20 | |
|---|
| 21 | =head1 NAME |
|---|
| 22 | |
|---|
| 23 | mp3db - Frontend for creating and updating a database for MP3::Find::DB |
|---|
| 24 | |
|---|
| 25 | =head1 SYNOPSIS |
|---|
| 26 | |
|---|
| 27 | # create the database file |
|---|
| 28 | $ mp3db --create --file my_mp3.db |
|---|
| 29 | |
|---|
| 30 | # add info |
|---|
| 31 | $ mp3db --file my_mp3.db ~/mp3 |
|---|
| 32 | |
|---|
| 33 | # update, and add results from another directory |
|---|
| 34 | $ mp3db --file my_mp3.db ~/mp3 ~/cds |
|---|
| 35 | |
|---|
| 36 | =head1 DESCRIPTION |
|---|
| 37 | |
|---|
| 38 | mp3db [options] [directory] [directories...] |
|---|
| 39 | |
|---|
| 40 | Creates and/or updates a database of ID3 data from the mp3s found |
|---|
| 41 | in the given directories. |
|---|
| 42 | |
|---|
| 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.