#!/usr/bin/env perl

use strict;
use warnings;

use WebService::SQLFormat;

my $formatter = WebService::SQLFormat->new(
    identifier_case => 'upper',
    reindent        => 1,
);

my $in;

while (<STDIN>) {
    $in .= $_;
}

$in ||= shift @ARGV;

die 'No SQL found' unless $in;

print $formatter->format_sql($in);

# PODNAME: sql-webformat

__END__

=pod

=encoding UTF-8

=head1 NAME

sql-webformat

=head1 VERSION

version 0.000006

=head1 AUTHOR

Olaf Alders <olaf@wundercounter.com>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by Olaf Alders.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut
