/libs/perl/Choicetool/Base/Program.pm
Perl | 78 lines | 45 code | 13 blank | 20 comment | 1 complexity | 2cf3a342dbea6a60f6ea39818df62da5 MD5 | raw file
Possible License(s): GPL-2.0
- # -*- perl -*-
- #
- # Program.pm
- #
- # Copyright (C) 2008, 2009 Francesco Salvestrini
- #
- # 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 2 of the License, or
- # (at your option) 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, write to the Free Software Foundation, Inc.,
- # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- #
- package Choicetool::Base::Program;
- use 5.8.0;
- use warnings;
- use strict;
- use diagnostics;
- use Choicetool::Autoconfig;
- use Choicetool::Base::Debug;
- BEGIN {
- use Exporter ();
- our ($VERSION, @ISA, @EXPORT);
- @ISA = qw(Exporter);
- @EXPORT = qw(&version
- &hint
- &program_name_set);
- }
- sub program_name_set ($)
- {
- }
- sub version ()
- {
- assert(defined($::PROGRAM_NAME));
- assert($::PROGRAM_NAME ne "");
- print $::PROGRAM_NAME .
- " (" . $Choicetool::Autoconfig::PACKAGE_NAME . ") " .
- $Choicetool::Autoconfig::PACKAGE_VERSION . "\n";
- print "\n";
- print "Copyright (C) 2008, 2009 Francesco Salvestrini\n";
- print "\n";
- print "This is free software. You may redistribute copies of it under " .
- "the terms of\n";
- print "the GNU General Public License " .
- "<http://www.gnu.org/licenses/gpl.html>.\n";
- print "There is NO WARRANTY, to the extent permitted by law.\n";
- }
- sub hint ($)
- {
- my $string = shift;
- if (defined($string)) {
- assert($string ne "");
- print $::PROGRAM_NAME . ": " . $string . "\n";
- }
- print "Try \`" . $::PROGRAM_NAME . " -h' for more information.\n";
- }
- 1;