Index: /trunk/PS-IPP-MetaDB/scripts/mdb-new2newed
===================================================================
--- /trunk/PS-IPP-MetaDB/scripts/mdb-new2newed	(revision 5166)
+++ /trunk/PS-IPP-MetaDB/scripts/mdb-new2newed	(revision 5166)
@@ -0,0 +1,143 @@
+#!/usr/bin/env perl
+
+# Copyright (C) 2005  Joshua Hoblitt
+#
+# $Id: mdb-new2newed,v 1.1 2005-09-28 04:31:32 jhoblitt Exp $
+
+use strict;
+use warnings FATAL => qw( all );
+
+use vars qw( $VERSION );
+$VERSION = '0.01';
+
+use PS::IPP::MetaDB;
+
+use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
+use Pod::Usage qw( pod2usage );
+
+my ($db, $dbuser, $dbpass);
+
+$db     = $ENV{'MDB_DB'} unless $db;
+$dbuser = $ENV{'MDB_USER'} unless $dbuser;
+$dbpass = $ENV{'MDB_PASS'} unless $dbpass;
+
+my ($exp_id, $class_id, $url);
+
+GetOptions(
+    'db=s'      => \$db,
+    'user=s'    => \$dbuser,
+    'pass=s'    => \$dbpass,
+    'exp_id=s'  => \$exp_id,
+    'class_id=s'=> \$class_id,
+    'url=s'     => \$url,
+) || pod2usage( 2 );
+
+pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
+pod2usage( -msg => "Required options: --db --user --pass", -exitval => 2 )
+    unless defined $db and defined $dbuser; # and defined $dbpass;
+pod2usage( -msg => "Required options: --exp_id --class_id --url", -exitval => 2)
+    unless defined $exp_id and defined $class_id and defined $url;
+
+PS::IPP::MetaDB->new2newed(
+    exp_id      => $exp_id,
+    class_id    => $class_id,
+    url         => $url,
+);
+
+__END__
+
+=pod
+
+=head1 NAME
+
+mdb-new2newed - register a file as successfully downloaded
+
+=head1 SYNOPSIS
+
+    mdb-new2newed [--db <database>] [--user <username>] [--pass <password>]
+
+=head1 DESCRIPTION
+
+=head1 OPTIONS
+
+=over 4
+
+=item * --db|-d <database>
+
+Name of database (C<namespace>) to create tables in.
+
+Optional if the appropriate environment variable is set.
+
+=item * --user|-u <username>
+
+Username to authenticate with.
+
+Optional if the appropriate environment variable is set.
+
+=item * --pass|-p <password>
+
+Password to authenticate with.
+
+Optional if the appropriate environment variable is set.
+
+=back
+
+=head1 ENVIRONMENT
+
+These environment variables may be used in place of the specified command line
+options.  All command line option will override the corresponding environment
+value.
+
+=over 4
+
+=item * C<MDB_DB>
+
+Equivalent to --db|-d
+
+=item * C<MDB_USER>
+
+Equivalent to --user|-u
+
+=item * C<MDB_PASS>
+
+Equivalent to --pass|-p
+
+=back
+
+=head1 CREDITS
+
+Just me, myself, and I.
+
+=head1 SUPPORT
+
+Please contact the author directly via e-mail.
+
+=head1 AUTHOR
+
+Joshua Hoblitt <jhoblitt@cpan.org>
+
+=head1 COPYRIGHT
+
+Copyright (C) 2005  Joshua Hoblitt.  All rights reserved.
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA  02111-1307, USA.
+
+The full text of the license can be found in the L<perlgpl> Pod as supplied
+with Perl 5.8.1 and later.
+
+=head1 SEE ALSO
+
+L<PS::IPP::MetaDB>
+
+=cut
