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 #=======================================================================
31 $progname =~ s/^.*\/(.*?)$/$1/;
32 our $VERSION = "0.00";
34 Getopt
::Long
::Configure
("bundling");
37 "debug" => \
$Opt{'debug'},
38 "help|h" => \
$Opt{'help'},
39 "verbose|v+" => \
$Opt{'verbose'},
40 "version" => \
$Opt{'version'},
42 ) || die("$progname: Option error. Use -h for help.\n");
44 $Opt{'debug'} && ($Debug = 1);
45 $Opt{'help'} && usage
(0);
46 if ($Opt{'version'}) {
52 if (/^(.*?\s+)(lon="\S+")(\s+)(lat="\S+?")(>.*)/) {
53 print("$1$4$3$2$5\n");
60 # Print program version {{{
61 print("$progname v$VERSION\n");
66 # Send the help message to stdout {{{
69 if ($Opt{'verbose'}) {
75 Usage: $progname [options] [file [files [...]]]
82 Increase level of verbosity. Can be repeated.
84 Print version information.
86 Print debugging messages.
94 # Print a status message to stderr based on verbosity level {{{
95 my ($verbose_level, $Txt) = @_;
97 if ($Opt{'verbose'} >= $verbose_level) {
98 print(STDERR
"$progname: $Txt\n");
104 # Print a debugging message {{{
106 my @call_info = caller;
107 chomp(my $Txt = shift);
108 my $File = $call_info[1];
110 $File =~ s
#^.*/(.*?)$#$1#;
111 print(STDERR
"$File:$call_info[2] $$ $Txt\n");
118 # Plain Old Documentation (POD) {{{
128 [options] [file [files [...]]]
138 =item B<-h>, B<--help>
140 Print a brief help summary.
142 =item B<-v>, B<--verbose>
144 Increase level of verbosity. Can be repeated.
148 Print version information.
152 Print debugging messages.
162 Made by Øyvind A. Holm S<E<lt>sunny@sunbase.orgE<gt>>.
166 Copyleft © Øyvind A. Holm E<lt>sunny@sunbase.orgE<gt>
167 This is free software; see the file F<COPYING> for legalese stuff.
171 This program is free software: you can redistribute it and/or modify it
172 under the terms of the GNU General Public License as published by the
173 Free Software Foundation, either version 3 of the License, or (at your
174 option) any later version.
176 This program is distributed in the hope that it will be useful, but
177 WITHOUT ANY WARRANTY; without even the implied warranty of
178 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
179 See the GNU General Public License for more details.
181 You should have received a copy of the GNU General Public License along
183 If not, see L<http://www.gnu.org/licenses/>.
191 # vim: set fenc=UTF-8 ft=perl fdm=marker ts=4 sw=4 sts=4 et fo+=w :