Commit | Line | Data |
2005eba8 |
1 | #!/usr/bin/env perl |
2 | |
3 | use SQL::Abstract::Tree; |
ffce8d5f |
4 | use Getopt::Long::Descriptive; |
2005eba8 |
5 | |
ffce8d5f |
6 | my ($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 |
14 | my $sqlat = SQL::Abstract::Tree->new({ profile => $opt->profile, fill_in_placeholders => 0 }); |
2005eba8 |
15 | |
16 | print $sqlat->format($_) . "\n" while <>; |