Patch against v0.11005 attached.

Andrew

Index: lib/SQL/Translator/Producer/HTML.pm
===================================================================
--- lib/SQL/Translator/Producer/HTML.pm	(revision 1)
+++ lib/SQL/Translator/Producer/HTML.pm	(working copy)
@@ -72,7 +72,8 @@
             $q->hr;
     }
 
-    @table_names = grep { length $_->name } $schema->get_tables; 
+    @table_names = grep { length $_->name } $schema->get_tables;
+    @table_names = sort @table_names if defined $args->{'sort'}; 
 
     if ($linktable) {
         # Generate top menu, with links to full table information
@@ -108,8 +109,8 @@
         push @html, $q->end_table;
     }
 
-    for my $table ($schema->get_tables) {
-        my $table_name = $table->name       or next;
+    for my $table_name (@table_names) {
+        my $table      = $schema->get_table($table_name);
         my @fields     = $table->get_fields or next;
         push @html,
             $q->comment("Starting table '$table_name'"),
Index: script/sqlt
===================================================================
--- script/sqlt	(revision 1)
+++ script/sqlt	(working copy)
@@ -108,6 +108,7 @@
   HTML/POD Producer Options:
 
     --pretty           Use CGI::Pretty for the output
+    --sort             Present tables in alphabetical order
     --title            Title of schema
 
   TTSchema Producer Options:
@@ -175,6 +176,7 @@
 my $imap_file;        # filename where to place image map coords
 my $imap_url;         # URL to use in making image map
 my $pretty;           # use CGI::Pretty instead of CGI (HTML producer)
+my $sorted;           # present tables in alphabetical order (HTML producer)
 my $template;         # template to pass to TTSchema producer
 my %tt_vars;          # additional template vars to pass the TTSchema producer
 my %tt_conf;          # additional template conf to pass the TTSchema producer
@@ -213,6 +215,7 @@
     't|to|producer:s'  => \$to,
     'l|list'           => \$list,
     'pretty!'          => \$pretty,
+    'sort!'            => \$sorted,
     'no-comments'      => \$no_comments,
     'no-scan'          => \$no_scan,
     'no-trim'          => \$no_trim,
@@ -302,6 +305,7 @@
         imap_file        => $imap_file,
         imap_url         => $imap_url,
         pretty           => $pretty,
+        sort             => $sorted,
         ttfile           => $template,
         tt_vars          => \%tt_vars,
         tt_conf          => \%tt_conf,

------------------------------------------------------------------------------

-- 
sqlfairy-developers mailing list
sqlfairy-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlfairy-developers

Reply via email to