#!/usr/bin/perl
use strict;
use vars qw($VERSION);
use Getopt::Std::Strict 'dhvgGa:y:e:';
$VERSION = sprintf "%d.%02d", q$Revision: 1.1 $ =~ /(\d+)/g;

init();

print ( $opt_g ? gnu_lgpl() : gnu_gpl() );

exit;



sub usage {
   qq{$0 - print gnu license to stdout

OPTIONS

   -d          debug on
   -h          help
   -v          version and exit
   -G          GNU GPL license (default), not for proprietary use
   -g          GNU LGPG lesser license allows some proprietary use
   -a string   author name
   -y yyyy     year, defaults to present year
   -e string   email
   
Usage:

   $0 [OPTIONS]... > LICENSE

LEOCHARRE::Dev parent package

}}

sub init {
   $opt_h and print usage() and exit;
   $opt_v and print $VERSION and exit;
   
   $opt_g or ($opt_G = 1);
   $opt_a ||='Leo Charre';
   $opt_e ||='leocharre at cpan dot org';
   require Time::Format;
   $opt_y ||=  Time::Format::time_format('yyyy',time());


}





sub gnu_gpl {
qq{
# ======================================================================
# Copyright (C) $opt_y  $opt_a <$opt_e>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
# ======================================================================

};
}
sub gnu_lgpl {
qq{
# =======================================================================
# Copyright (C) $opt_y  $opt_a <$opt_e>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# =======================================================================

};
}


