@@ -15,11 +15,12 @@ use Getopt::Long;
1515my $progname = " mysql2pgsql" ;
1616my $version = " 0.3" ;
1717
18- GetOptions(" debug!" , " verbose!" , " version" , " path=s" , " help" );
18+ GetOptions(" debug!" , " verbose!" , " version" , " path=s" , " help" , " data! " );
1919
2020my $debug = $opt_debug || 0;
2121my $verbose = $opt_verbose || 0;
2222my $pathfrom = $opt_path || " " ;
23+ my $nodata = (! $opt_data );
2324
2425$pathfrom = " $pathfrom /" if ($pathfrom =~ / .*[^\/ ]$ / );
2526
@@ -29,12 +30,15 @@ print "\t(c) 2000 Thomas Lockhart PostgreSQL Inc.\n"
2930 if ($opt_version && $opt_verbose || $opt_help );
3031
3132if ($opt_help ) {
32- print " $0 --verbose --version --help --path=dir infile ...\n " ;
33+ print " $0 --verbose --version --help --path=dir --nodata infile ...\n " ;
3334 exit ;
3435}
3536
3637while (@ARGV ) {
3738 my $ostem ;
39+ my $oname ;
40+ my $pname ;
41+ my @xargs ;
3842
3943 $iname = shift @ARGV ;
4044 $ostem = $iname ;
@@ -44,7 +48,10 @@ while (@ARGV) {
4448 $oname = " $ostem .sql92" ;
4549 $pname = " $ostem .init" ;
4650
47- print " $iname $oname $pname \n " if ($debug );
51+ @xargs = ($iname , $oname );
52+ push @xargs , $pname unless ($nodata );
53+
54+ print " @xargs \n " if ($debug );
4855
4956 TransformDumpFile($iname , $oname , $pname );
5057}
@@ -68,7 +75,7 @@ sub TransformDumpFile {
6875 push @dlines , $_ ;
6976 }
7077
71- print " Calling CreateSchema with $#dlines lines\n " if ($debug );
78+ print ( " Calling CreateSchema with $#dlines lines\n " ) if ($debug );
7279 @slines = CreateSchema(@dlines );
7380
7481 open (OUT, " >$oname " ) || die " Unable to open output file $oname " ;
0 commit comments