#!/usr/bin/perl

# $Id: parsediasql,v 1.7 2009/02/27 14:04:00 aff Exp $

use strict;
use warnings;

use Getopt::Long;
use Pod::Usage;

use lib q{lib};
use Parse::Dia::SQL;

my $help = undef;
my $file = undef;
my $db   = undef;

GetOptions(
  "help|?" => \$help,
  "file=s" => \$file,
  "db=s"   => \$db,
) or pod2usage(2);
pod2usage(1) if $help;
pod2usage(qq{Missing argument 'file'}) if !$file;
pod2usage(qq{Missing argument 'db'}) if !$db;

my $dia = Parse::Dia::SQL->new(file => $file, db => $db);
print $dia->get_sql();

__END__

=pod

=head1 NAME

  parsediasql - Command-line interface to Parse::Dia::SQL

=head1 SYNOPSIS

  parsediasql [OPTIONS] --file FILE --db DB

=head1 OPTIONS

  file -  filename of Dia file
  db   -  Database type (e.g. 'db2')

=head1 DESCRIPTION

Dia is a diagram creation program for Linux, Unix and Windows released
under the GPL license.

parsediasql is a Command-line interface to Parse::Dia::SQL

Parse::Dia::SQL converts Dia class diagrams into SQL. 

=head1 TODO

=over 

=item *

Add options that correspond to %param in Parse::Dia::SQL::new

=back

=head1 SEE ALSO

  Parse::Dia::SQL

=head1 AUTHOR

Parse::Dia::SQL is based on I<tedia2sql> by Tim Ellis and others.  See the
I<AUTHORS> file for details.

Modified by Andreas Faafeng, C<< <aff at cpan.org> >> for release on
CPAN.

=cut

