New commit in Git/spar/
[sunny256-utils.git] / svnlog2tab
blobd8cada1a1f00b1767b3fbb033496bdbfcb76ef61
1 #!/usr/bin/env perl
3 #=======================================================================
4 # svnlog2tab
5 # File ID: 2b7e200c-f744-11dd-98bf-000475e441b9
6 # [Description]
8 # Character set: UTF-8
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 #=======================================================================
14 use strict;
15 use warnings;
16 use Getopt::Long;
18 $| = 1;
20 our $Debug = 0;
22 our %Opt = (
24 'debug' => 0,
25 'help' => 0,
26 'verbose' => 0,
27 'version' => 0,
31 our $progname = $0;
32 $progname =~ s/^.*\/(.*?)$/$1/;
33 our $VERSION = "0.00";
35 Getopt::Long::Configure("bundling");
36 GetOptions(
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'}) {
48 print_version();
49 exit(0);
52 while (<>) {
53 print;
56 sub print_version {
57 # Print program version {{{
58 print("$progname v$VERSION\n");
59 # }}}
60 } # print_version()
62 sub usage {
63 # Send the help message to stdout {{{
64 my $Retval = shift;
66 if ($Opt{'verbose'}) {
67 print("\n");
68 print_version();
70 print(<<END);
72 Usage: $progname [options] [file [files [...]]]
74 Options:
76 -h, --help
77 Show this help.
78 -v, --verbose
79 Increase level of verbosity. Can be repeated.
80 --version
81 Print version information.
82 --debug
83 Print debugging messages.
85 END
86 exit($Retval);
87 # }}}
88 } # usage()
90 sub msg {
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");
97 # }}}
98 } # msg()
100 sub D {
101 # Print a debugging message {{{
102 $Debug || return;
103 my @call_info = caller;
104 chomp(my $Txt = shift);
105 my $File = $call_info[1];
106 $File =~ s#\\#/#g;
107 $File =~ s#^.*/(.*?)$#$1#;
108 print(STDERR "$File:$call_info[2] $$ $Txt\n");
109 return("");
110 # }}}
111 } # D()
113 __END__
115 # Plain Old Documentation (POD) {{{
117 =pod
119 =head1 NAME
123 =head1 SYNOPSIS
125 [options] [file [files [...]]]
127 =head1 DESCRIPTION
131 =head1 OPTIONS
133 =over 4
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.
143 =item B<--version>
145 Print version information.
147 =item B<--debug>
149 Print debugging messages.
151 =back
153 =head1 BUGS
157 =head1 AUTHOR
159 Made by Øyvind A. Holm S<E<lt>sunny@sunbase.orgE<gt>>.
161 =head1 COPYRIGHT
163 Copyleft © Øyvind A. Holm E<lt>sunny@sunbase.orgE<gt>
164 This is free software; see the file F<COPYING> for legalese stuff.
166 =head1 LICENCE
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
179 with this program.
180 If not, see L<http://www.gnu.org/licenses/>.
182 =head1 SEE ALSO
184 =cut
186 # }}}
188 # vim: set fenc=UTF-8 ft=perl fdm=marker ts=4 sw=4 sts=4 et fo+=w :