Swap CAG with Moo, lazify a lot of the profile selection
[dbsrgits/SQL-Abstract.git] / script / format-sql
CommitLineData
2005eba8 1#!/usr/bin/env perl
2
3use SQL::Abstract::Tree;
ffce8d5f 4use Getopt::Long::Descriptive;
2005eba8 5
ffce8d5f 6my ($opt, $usage) = describe_options(
7 'format-sql %o',
8 [ 'profile|p=s', "the profile to use", { default => 'console' } ],
9 [ 'help', "print usage message and exit" ],
10);
11
12 print($usage->text), exit if $opt->help;
13
0bfe80fd 14my $sqlat = SQL::Abstract::Tree->new({ profile => $opt->profile, fill_in_placeholders => 0 });
2005eba8 15
16print $sqlat->format($_) . "\n" while <>;