X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FTranslator%2FProducer%2FDumper.pm;h=b581d816f432d27e66ec6a66b1e593091c9d0c9d;hb=25afc77952caf80b7cd48a1efb58c50f968b5206;hp=6d46d25dd12c6d4e855bcc86289ff3f210163282;hpb=e96fe4d3ecfd4258cacb6532a2771ea40f74232c;p=dbsrgits%2FSQL-Translator.git diff --git a/lib/SQL/Translator/Producer/Dumper.pm b/lib/SQL/Translator/Producer/Dumper.pm index 6d46d25..b581d81 100644 --- a/lib/SQL/Translator/Producer/Dumper.pm +++ b/lib/SQL/Translator/Producer/Dumper.pm @@ -1,7 +1,7 @@ package SQL::Translator::Producer::Dumper; # ------------------------------------------------------------------- -# $Id: Dumper.pm,v 1.2 2004-03-09 19:35:40 kycl4rk Exp $ +# $Id: Dumper.pm,v 1.4 2004-04-23 00:44:10 kycl4rk Exp $ # ------------------------------------------------------------------- # Copyright (C) 2002-4 SQLFairy Authors # @@ -61,7 +61,7 @@ use vars qw($VERSION); use Data::Dumper; -$VERSION = sprintf "%d.%02d", q$Revision: 1.2 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.4 $ =~ /(\d+)\.(\d+)/; sub produce { my $t = shift; @@ -143,7 +143,8 @@ use DBI; use Getopt::Long; use File::Spec::Functions 'catfile'; -my ( $help, $add_truncate, $skip, $skiplike, $no_comments, $mysql_loadfile ); +my ( $help, $add_truncate, $skip, $skiplike, $no_comments, + $takelike, $mysql_loadfile ); GetOptions( 'add-truncate' => \$add_truncate, 'h|help' => \$help, @@ -151,12 +152,13 @@ GetOptions( 'mysql-loadfile' => \$mysql_loadfile, 'skip:s' => \$skip, 'skiplike:s' => \$skiplike, + 'takelike:s' => \$takelike, ); if ( $help ) { print <<"USAGE"; Usage: - $0 [options] + $0 [options] > dump.sql Options: -h|--help Show help and exit @@ -225,6 +227,7 @@ for my $table ( @tables ) { my $table_name = $table->{'table_name'}; next if $skip{ $table_name }; next if $skiplike && $table_name =~ qr/$skiplike/; + next if $takelike && $table_name !~ qr/$takelike/; my ( $out_fh, $outfile ); if ( $mysql_loadfile ) {