Per a suggestion from Darren, changed the skipping of tables in the GraphViz
[dbsrgits/SQL-Translator.git] / bin / sqlt-graph
index f20c71c..61c8ec4 100755 (executable)
@@ -59,7 +59,8 @@ sqlt-graph - Automatically create a graph from a database schema
     --show-sizes       Show column sizes for VARCHAR and CHAR fields
     --show-constraints Show list of constraints for each field
     -s|--skip          Fields to skip in natural joins
-    --skip-tables      Comma-separated list of regexen to exclude tables
+    --skip-tables      Comma-separated list of table names to exclude 
+    --skip-tables-like Comma-separated list of regexen to exclude tables
     --debug            Print debugging information
 
 =head1 DESCRIPTION
@@ -107,7 +108,7 @@ my (
     $layout, $node_shape, $out_file, $output_type, $db_driver, $add_color, 
     $natural_join, $join_pk_only, $skip_fields, $show_datatypes,
     $show_sizes, $show_constraints, $debug, $help, $height, $width,
-    $no_fields, $fontsize, $fontname, $skip_tables
+    $no_fields, $fontsize, $fontname, $skip_tables, $skip_tables_like
 );
 
 # multi-valued options:
@@ -116,29 +117,30 @@ my %nodeattrs = ();
 my %graphattrs = ();
 
 GetOptions(
-    'd|db|f|from=s'    => \$db_driver,
-    'o|output:s'       => \$out_file,
-    'l|layout:s'       => \$layout,
-    'n|node-shape:s'   => \$node_shape,
-    't|output-type:s'  => \$output_type,
-    'height:f'         => \$height,
-    'width:f'          => \$width,
-    'fontsize=i'       => \$fontsize,
-    'fontname=s'       => \$fontname,
-    'nodeattr=s'       => \%nodeattrs,
-    'edgeattr=s'       => \%edgeattrs,
-    'graphattr=s'      => \%graphattrs,
-    'c|color'          => \$add_color,
-    'no-fields'        => \$no_fields,
-    'natural-join'     => \$natural_join,
-    'natural-join-pk'  => \$join_pk_only,
-    's|skip:s'         => \$skip_fields,
-    'skip-tables:s'    => \$skip_tables,
-    'show-datatypes'   => \$show_datatypes,
-    'show-sizes'       => \$show_sizes,
-    'show-constraints' => \$show_constraints,
-    'debug'            => \$debug,
-    'h|help'           => \$help,
+    'd|db|f|from  =s'    => \$db_driver,
+    'o|output:s'         => \$out_file,
+    'l|layout:s'         => \$layout,
+    'n|node-shape:s'     => \$node_shape,
+    't|output-type:s'    => \$output_type,
+    'height:f'           => \$height,
+    'width:f'            => \$width,
+    'fontsize  =i'       => \$fontsize,
+    'fontname  =s'       => \$fontname,
+    'nodeattr  =s'       => \%nodeattrs,
+    'edgeattr  =s'       => \%edgeattrs,
+    'graphattr  =s'      => \%graphattrs,
+    'c|color'            => \$add_color,
+    'no-fields'          => \$no_fields,
+    'natural-join'       => \$natural_join,
+    'natural-join-pk'    => \$join_pk_only,
+    's|skip:s'           => \$skip_fields,
+    'skip-tables:s'      => \$skip_tables,
+    'skip-tables-like:s' => \$skip_tables_like,
+    'show-datatypes'     => \$show_datatypes,
+    'show-sizes'         => \$show_sizes,
+    'show-constraints'   => \$show_constraints,
+    'debug'              => \$debug,
+    'h|help'             => \$help,
 ) or die pod2usage;
 my @files = @ARGV; # the create script(s) for the original db
 
@@ -160,6 +162,7 @@ my $translator           =  SQL::Translator->new(
         natural_join_pk  => $join_pk_only,
         skip_fields      => $skip_fields,
         skip_tables      => $skip_tables,
+        skip_tables_like => $skip_tables_like,
         show_datatypes   => $show_datatypes,
         show_sizes       => $show_sizes,
         show_constraints => $show_constraints,