replaced Test::Deep::NoTest with Data::Compare to not break Test::Deep tests
[dbsrgits/DBIx-Class.git] / script / dbicadmin
index 52a5491..10cd89f 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 use strict;
 use warnings;
@@ -50,7 +50,7 @@ my ($opts, $usage) = describe_options(
     ['resultset|resultset-class|class:s' => 'The resultset to operate on for data manipulation' ],
     ['config-stanza:s' => 'Where in the config to find the connection_info, supply in form MyApp::Model::DB',],
     ['config:s' => 'Supply the config file for parsing by Config::Any', { depends => 'config_stanza'} ],
-    ['connect-info:s%' => 'Supply the connect info as additonal options ie -I dsn=<dsn> user=<user> password=<pass> '],
+    ['connect-info:s%' => 'Supply the connect info as additional options ie -I dsn=<dsn> user=<user> password=<pass> '],
     ['connect:s' => 'Supply the connect info as a json string' ],
     ['sql-dir:s' => 'The directory where sql diffs will be created'],
     ['sql-type:s' => 'The RDBMs flavour you wish to use'],
@@ -62,7 +62,7 @@ my ($opts, $usage) = describe_options(
     ['force' => 'Be forceful with some operations'],
     ['trace' => 'Turn on DBIx::Class trace output'],
     ['quiet' => 'Be less verbose'],
-    ['I:s@' => 'Same as perl\'s -I']
+    ['I:s@' => 'Same as perl\'s -I, prepended to current @INC'],
   )
 );
 
@@ -87,22 +87,22 @@ if($opts->{selfinject_pod}) {
     );
 }
 
-if($opts->{I}) {
-    $opts->{include} = delete $opts->{I};
+# FIXME - lowercasing will eventually go away when Getopt::Long::Descriptive is fixed
+if($opts->{i}) {
+  require lib;
+  lib->import( @{delete $opts->{i}} );
 }
 
 if($opts->{help}) {
-    $usage->die();
+  $usage->die();
 }
 
 # option compatability mangle
 if($opts->{connect}) {
   $opts->{connect_info} = delete $opts->{connect};
 }
-
 my $admin = DBIx::Class::Admin->new( %$opts );
 
-
 my $action = $opts->{action};
 
 $action = $opts->{op} if ($action eq 'op');