Fixed "database_events."
[dbsrgits/SQL-Translator.git] / bin / sqlt-diff-old
index 342b705..96a3c92 100755 (executable)
@@ -1,10 +1,8 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 # vim: set ft=perl:
 
 # -------------------------------------------------------------------
-# $Id: sqlt-diff-old,v 1.1 2007-10-24 10:55:44 schiffbruechige Exp $
-# -------------------------------------------------------------------
-# Copyright (C) 2002-4 The SQLFairy Authors
+# Copyright (C) 2002-2009 The SQLFairy Authors
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
@@ -91,13 +89,14 @@ your target database.
 # -------------------------------------------------------------------
 
 use strict;
+use warnings;
 use Pod::Usage;
 use Data::Dumper;
 use SQL::Translator;
 use SQL::Translator::Schema::Constants;
 
 use vars qw( $VERSION );
-$VERSION = sprintf "%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/;
+$VERSION = '1.59';
 
 my ( @input, $list, $help, $debug );
 for my $arg ( @ARGV ) {
@@ -120,6 +119,15 @@ for my $arg ( @ARGV ) {
 
 pod2usage(1) if $help;
 pod2usage('Please specify only two schemas to diff') if scalar @input > 2;
+pod2usage('No input') if !@input;
+
+if ( my $interactive = -t STDIN && -t STDOUT ) {
+    print STDERR join("\n",
+        "sqlt-diff-old is deprecated. Please sqlt-diff, and tell us ",
+        "about any problems or patch SQL::Translator::Diff",
+        '',
+    );
+}
 
 my $tr            = SQL::Translator->new;
 my @parsers       = $tr->list_parsers;
@@ -453,8 +461,6 @@ if ( @diffs ) {
     }
 }
 
-print STDERR "sqlt-diff-old is deprecated, please try and use sqlt-diff, and tell us about any problems or patch SQL::Translator::Diff\n";
-    
 if ( @diffs ) {
     print join( "\n", 
         "-- Convert schema '$s2_name' to '$s1_name':\n", @diffs, "\n"
@@ -543,7 +549,7 @@ sub constraint_to_string {
 
 =head1 AUTHOR
 
-Ken Y. Clark E<lt>kclark@cpan.orgE<gt>.
+Ken Youens-Clark E<lt>kclark@cpan.orgE<gt>.
 
 =head1 SEE ALSO