3 #=======================================================================
5 # File ID: 2b7e200c-f744-11dd-98bf-000475e441b9
9 # ©opyleft 2006– Øyvind A. Holm <sunny@sunbase.org>
10 # License: GNU General Public License version 2 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");
63 # Send the help message to stdout {{{
66 if ($Opt{'verbose'}) {
72 Usage: $progname [options] [file [files [...]]]
79 Increase level of verbosity. Can be repeated.
81 Print version information.
83 Print debugging messages.
91 # Print a status message to stderr based on verbosity level {{{
92 my ($verbose_level, $Txt) = @_;
94 if ($Opt{'verbose'} >= $verbose_level) {
95 print(STDERR
"$progname: $Txt\n");
101 # Print a debugging message {{{
103 my @call_info = caller;
104 chomp(my $Txt = shift);
105 my $File = $call_info[1];
107 $File =~ s
#^.*/(.*?)$#$1#;
108 print(STDERR
"$File:$call_info[2] $$ $Txt\n");
115 # Plain Old Documentation (POD) {{{
125 [options] [file [files [...]]]
135 =item B<-h>, B<--help>
137 Print a brief help summary.
139 =item B<-v>, B<--verbose>
141 Increase level of verbosity. Can be repeated.
145 Print version information.
149 Print debugging messages.
159 Made by Øyvind A. Holm S<E<lt>sunny@sunbase.orgE<gt>>.
163 Copyleft © Øyvind A. Holm E<lt>sunny@sunbase.orgE<gt>
164 This is free software; see the file F<COPYING> for legalese stuff.
168 This program is free software: you can redistribute it and/or modify it
169 under the terms of the GNU General Public License as published by the
170 Free Software Foundation, either version 2 of the License, or (at your
171 option) any later version.
173 This program is distributed in the hope that it will be useful, but
174 WITHOUT ANY WARRANTY; without even the implied warranty of
175 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
176 See the GNU General Public License for more details.
178 You should have received a copy of the GNU General Public License along
180 If not, see L<http://www.gnu.org/licenses/>.
188 # vim: set fenc=UTF-8 ft=perl fdm=marker ts=4 sw=4 sts=4 et fo+=w :