3 #=======================================================================
5 # File ID: 292fa714-5d3a-11df-83e3-90e6ba3022ac
7 # Lister ut linjer med 8-bits tegn
10 # ©opyleft STDyearDTS– Øyvind A. Holm <sunny@sunbase.org>
11 # License: GNU General Public License version 2 or later, see end of
12 # file for legal stuff.
13 #=======================================================================
31 $progname =~ s/^.*\/(.*?)$/$1/;
32 our $VERSION = '0.1.0';
34 Getopt
::Long
::Configure
('bundling');
37 'help|h' => \
$Opt{'help'},
38 'quiet|q+' => \
$Opt{'quiet'},
39 'verbose|v+' => \
$Opt{'verbose'},
40 'version' => \
$Opt{'version'},
42 ) || die("$progname: Option error. Use -h for help.\n");
44 $Opt{'verbose'} -= $Opt{'quiet'};
45 $Opt{'help'} && usage
(0);
46 if ($Opt{'version'}) {
58 /[\x80-\xFF]/ && print;
66 # Print program version {{{
67 print("$progname $VERSION\n");
73 # Send the help message to stdout {{{
76 if ($Opt{'verbose'}) {
82 Usage: $progname [options] [file [files [...]]]
89 Be more quiet. Can be repeated to increase silence.
91 Increase level of verbosity. Can be repeated.
93 Print version information.
101 # Print a status message to stderr based on verbosity level {{{
102 my ($verbose_level, $Txt) = @_;
104 if ($Opt{'verbose'} >= $verbose_level) {
105 print(STDERR
"$progname: $Txt\n");
113 # This program is free software; you can redistribute it and/or modify
114 # it under the terms of the GNU General Public License as published by
115 # the Free Software Foundation; either version 2 of the License, or (at
116 # your option) any later version.
118 # This program is distributed in the hope that it will be useful, but
119 # WITHOUT ANY WARRANTY; without even the implied warranty of
120 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
121 # See the GNU General Public License for more details.
123 # You should have received a copy of the GNU General Public License
124 # along with this program.
125 # If not, see L<http://www.gnu.org/licenses/>.
127 # vim: set fenc=UTF-8 ft=perl fdm=marker ts=4 sw=4 sts=4 et fo+=w :