From: Ken Youens-Clark Date: Thu, 12 Aug 2004 16:18:00 +0000 (+0000) Subject: Added "version" argument to show SQLT::VERSION. X-Git-Tag: v0.06~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4ae3a77976757d99f3eddd9ef5bc467e59e82594;p=dbsrgits%2FSQL-Translator.git Added "version" argument to show SQLT::VERSION. --- diff --git a/bin/sqlt b/bin/sqlt index df5d371..7f46ca0 100755 --- a/bin/sqlt +++ b/bin/sqlt @@ -2,7 +2,7 @@ # vim: set ft=perl: # ------------------------------------------------------------------- -# $Id: sqlt,v 1.14 2004-07-08 20:37:53 grommit Exp $ +# $Id: sqlt,v 1.15 2004-08-12 16:18:00 kycl4rk Exp $ # ------------------------------------------------------------------- # Copyright (C) 2002-4 SQLFairy Authors # @@ -46,6 +46,7 @@ To translate a schema: -d|--debug Print debug info -v|--validate Validate the schema + --version Show the version of SQL::Translator --trace Print parser trace info --show-warnings Print warnings to STDERR @@ -122,7 +123,7 @@ use Pod::Usage; use SQL::Translator; use vars qw( $VERSION ); -$VERSION = sprintf "%d.%02d", q$Revision: 1.14 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.15 $ =~ /(\d+)\.(\d+)/; my $from; # the original database my $to; # the destination database @@ -151,6 +152,7 @@ my $indent; # Number of indent chars for XML my $dsn; # DBI parser my $db_user; # DBI parser my $db_password; # DBI parser +my $show_version; # Show version and exit script my $skip; my $skiplike; my $dumper_db_user; @@ -191,6 +193,7 @@ GetOptions( 'prefix:s' => \$prefix, 'indent:s' => \$indent, 'newlines!' => \$newlines, + 'version' => \$show_version, ) or pod2usage(2); my @files = @ARGV; # source files @@ -205,6 +208,11 @@ unless ( @files ) { pod2usage(1) if $help; +if ( $show_version ) { + print "SQL::Translator v", $SQL::Translator::VERSION, "\n"; + exit(0); +} + my $translator = SQL::Translator->new( debug => $debug || 0, trace => $trace || 0,