3 #=======================================================================
5 # File ID: 42441484-6158-11df-b790-90e6ba3022ac
6 # Setter lat og lon på veipunkter i «riktig» rekkefølge.
9 # ©opyleft 2010– Ø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'}) {
53 if (/^(.*?\s+)(lon="\S+")(\s+)(lat="\S+?")(>.*)/) {
54 print("$1$4$3$2$5\n");
61 # Print program version {{{
62 print("$progname v$VERSION\n");
67 # Send the help message to stdout {{{
70 if ($Opt{'verbose'}) {
76 Usage: $progname [options] [file [files [...]]]
83 Increase level of verbosity. Can be repeated.
85 Print version information.
87 Print debugging messages.
95 # Print a status message to stderr based on verbosity level {{{
96 my ($verbose_level, $Txt) = @_;
98 if ($Opt{'verbose'} >= $verbose_level) {
99 print(STDERR
"$progname: $Txt\n");
105 # Print a debugging message {{{
107 my @call_info = caller;
108 chomp(my $Txt = shift);
109 my $File = $call_info[1];
111 $File =~ s
#^.*/(.*?)$#$1#;
112 print(STDERR
"$File:$call_info[2] $$ $Txt\n");
119 # Plain Old Documentation (POD) {{{
129 [options] [file [files [...]]]
139 =item B<-h>, B<--help>
141 Print a brief help summary.
143 =item B<-v>, B<--verbose>
145 Increase level of verbosity. Can be repeated.
149 Print version information.
153 Print debugging messages.
163 Made by Øyvind A. Holm S<E<lt>sunny@sunbase.orgE<gt>>.
167 Copyleft © Øyvind A. Holm E<lt>sunny@sunbase.orgE<gt>
168 This is free software; see the file F<COPYING> for legalese stuff.
172 This program is free software: you can redistribute it and/or modify it
173 under the terms of the GNU General Public License as published by the
174 Free Software Foundation, either version 3 of the License, or (at your
175 option) any later version.
177 This program is distributed in the hope that it will be useful, but
178 WITHOUT ANY WARRANTY; without even the implied warranty of
179 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
180 See the GNU General Public License for more details.
182 You should have received a copy of the GNU General Public License along
184 If not, see L<http://www.gnu.org/licenses/>.
192 # vim: set fenc=UTF-8 ft=perl fdm=marker ts=4 sw=4 sts=4 et fo+=w :