Added equals function for equality testing
[dbsrgits/SQL-Translator.git] / bin / sqlt
index 7f46ca0..1117b3e 100755 (executable)
--- a/bin/sqlt
+++ b/bin/sqlt
@@ -2,7 +2,7 @@
 # vim: set ft=perl:
 
 # -------------------------------------------------------------------
-# $Id: sqlt,v 1.15 2004-08-12 16:18:00 kycl4rk Exp $
+# $Id: sqlt,v 1.17 2004-11-26 00:34:09 grommit Exp $
 # -------------------------------------------------------------------
 # Copyright (C) 2002-4 SQLFairy Authors
 #
@@ -89,7 +89,9 @@ To translate a schema:
 
   TTSchema Producer Options:
 
-    --template         The path to the template
+    --template             The path to the template
+    --tt-var var=value     Pass extra variables to the template
+    --tt-conf option=value Pass extra config options to Template
 
   XML-SQLFairy Producer Options:
 
@@ -123,7 +125,7 @@ use Pod::Usage;
 use SQL::Translator;
 
 use vars qw( $VERSION );
-$VERSION = sprintf "%d.%02d", q$Revision: 1.15 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.17 $ =~ /(\d+)\.(\d+)/;
 
 my $from;             # the original database
 my $to;               # the destination database
@@ -144,6 +146,8 @@ my $imap_file;        # filename where to place image map coords
 my $imap_url;         # URL to use in making image map
 my $pretty;           # use CGI::Pretty instead of CGI (HTML producer)
 my $template;         # template to pass to TTSchema producer
+my %tt_vars;          # additional template vars to pass the TTSchema producer
+my %tt_conf;          # additional template conf to pass the TTSchema producer
 my $title;            # title for HTML/POD producer
 my $add_prefix;       # Use explicit namespace prefix (XML producer)
 my $prefix;           # Set explicit namespace prefix (XML producer)
@@ -177,6 +181,8 @@ GetOptions(
     'rs:s'             => \$record_separator,
     'show-warnings'    => \$show_warnings,
     'template:s'       => \$template,
+    'tt-var=s'         => \%tt_vars,
+    'tt-conf=s'        => \%tt_conf,
     'title:s'          => \$title,
     'trace'            => \$trace,
     'v|validate'       => \$validate,
@@ -234,6 +240,8 @@ my $translator           =  SQL::Translator->new(
         imap_url         => $imap_url,
         pretty           => $pretty,
         ttfile           => $template,
+        tt_vars          => \%tt_vars,
+        tt_conf          => \%tt_conf,
         title            => $title,
         dsn              => $dumper_dsn,
         db_user          => $dumper_db_user,