3 #=======================================================================
5 # File ID: c3b793a4-6225-11e1-bae9-37679d2dbe43
9 # ©opyleft 2012– Øyvind A. Holm <sunny@sunbase.org>
10 # License: GNU General Public License version 3 or later, see end of
11 # file for legal stuff.
12 #=======================================================================
32 $progname =~ s/^.*\/(.*?)$/$1/;
33 our $VERSION = '0.00';
35 Getopt
::Long
::Configure
('bundling');
38 'debug' => \
$Opt{'debug'},
39 'help|h' => \
$Opt{'help'},
40 'verbose|v+' => \
$Opt{'verbose'},
41 'version' => \
$Opt{'version'},
43 ) || die("$progname: Option error. Use -h for help.\n");
45 $Opt{'debug'} && ($Debug = 1);
46 $Opt{'help'} && usage
(0);
47 if ($Opt{'version'}) {
57 # Print program version {{{
58 print("$progname v$VERSION\n");
64 # Send the help message to stdout {{{
67 if ($Opt{'verbose'}) {
73 Usage: $progname [options] [file [files [...]]]
80 Increase level of verbosity. Can be repeated.
82 Print version information.
84 Print debugging messages.
92 # Print a status message to stderr based on verbosity level {{{
93 my ($verbose_level, $Txt) = @_;
95 if ($Opt{'verbose'} >= $verbose_level) {
96 print(STDERR
"$progname: $Txt\n");
103 # Print a debugging message {{{
105 my @call_info = caller;
106 chomp(my $Txt = shift);
107 my $File = $call_info[1];
109 $File =~ s
#^.*/(.*?)$#$1#;
110 print(STDERR
"$File:$call_info[2] $$ $Txt\n");
117 # Plain Old Documentation (POD) {{{
127 [options] [file [files [...]]]
137 =item B<-h>, B<--help>
139 Print a brief help summary.
141 =item B<-v>, B<--verbose>
143 Increase level of verbosity. Can be repeated.
147 Print version information.
151 Print debugging messages.
161 Made by Øyvind A. Holm S<E<lt>sunny@sunbase.orgE<gt>>.
165 Copyleft © Øyvind A. Holm E<lt>sunny@sunbase.orgE<gt>
166 This is free software; see the file F<COPYING> for legalese stuff.
170 This program is free software: you can redistribute it and/or modify it
171 under the terms of the GNU General Public License as published by the
172 Free Software Foundation, either version 3 of the License, or (at your
173 option) any later version.
175 This program is distributed in the hope that it will be useful, but
176 WITHOUT ANY WARRANTY; without even the implied warranty of
177 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
178 See the GNU General Public License for more details.
180 You should have received a copy of the GNU General Public License along
182 If not, see L<http://www.gnu.org/licenses/>.
190 # vim: set fenc=UTF-8 ft=perl fdm=marker ts=4 sw=4 sts=4 et fo+=w :