requires 'List::Util' => 0;
requires 'Scalar::Util' => 0;
requires 'Class::Accessor::Grouped' => 0.09005;
+requires 'Getopt::Long::Descriptive' => 0.086;
requires 'Hash::Merge' => 0.12;
test_requires "Test::More" => 0.92;
no_index package => 'DBIx::Class::Storage::Debug::PrettyPrint';
no_index directory => 'examples';
+install_script 'format-sql';
+
tests_recursive 't';
WriteAll();
#!/usr/bin/env perl
use SQL::Abstract::Tree;
+use Getopt::Long::Descriptive;
-my $sqlat = SQL::Abstract::Tree->new({ profile => 'console' });
+my ($opt, $usage) = describe_options(
+ 'format-sql %o',
+ [ 'profile|p=s', "the profile to use", { default => 'console' } ],
+ [ 'help', "print usage message and exit" ],
+);
+
+ print($usage->text), exit if $opt->help;
+
+my $sqlat = SQL::Abstract::Tree->new({ profile => $opt->profile });
print $sqlat->format($_) . "\n" while <>;