Cleaned up a bit, checked for interactive tty so that ugly warning
[dbsrgits/SQL-Translator.git] / bin / sqlt-diff-old
index 4aff12f..96a3c92 100755 (executable)
@@ -119,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;
@@ -452,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"