3 #=======================================================================
5 # File ID: 3c899bbc-5d49-11df-b62a-90e6ba3022ac
7 # Inserts a COMBINING LOW LINE (U+0332, "◌̲") after every character
10 # Character set: UTF-8
11 # ©opyleft 2004– Øyvind A. Holm <sunny@sunbase.org>
12 # License: GNU General Public License version 2 or later, see end of
13 # file for legal stuff.
14 #=======================================================================
20 use open ':std', ':encoding(UTF-8)';
35 $progname =~ s/^.*\/(.*?)$/$1/;
36 our $VERSION = '0.1.0';
38 Getopt
::Long
::Configure
('bundling');
41 'help|h' => \
$Opt{'help'},
42 'quiet|q+' => \
$Opt{'quiet'},
43 'strikethrough|s' => \
$Opt{'strikethrough'},
44 'verbose|v+' => \
$Opt{'verbose'},
45 'version' => \
$Opt{'version'},
47 ) || die("$progname: Option error. Use -h for help.\n");
49 $Opt{'verbose'} -= $Opt{'quiet'};
50 $Opt{'help'} && usage
(0);
51 if ($Opt{'version'}) {
61 my $combchar = "\x{0332}";
63 if ($Opt{'strikethrough'}) {
64 $combchar = "\x{0336}";
67 s/([^\n])/$1$combchar/g;
76 # Print program version {{{
77 print("$progname $VERSION\n");
83 # Send the help message to stdout {{{
86 if ($Opt{'verbose'}) {
92 Usage: $progname [options] [file [files [...]]]
99 Be more quiet. Can be repeated to increase silence.
101 Use strikethrough (U+0336, '1̶2̶3̶ ̶a̶b̶c̶') instead of underline.
103 Increase level of verbosity. Can be repeated.
105 Print version information.
113 # Print a status message to stderr based on verbosity level {{{
114 my ($verbose_level, $Txt) = @_;
116 if ($Opt{'verbose'} >= $verbose_level) {
117 print(STDERR
"$progname: $Txt\n");
125 # This program is free software; you can redistribute it and/or modify
126 # it under the terms of the GNU General Public License as published by
127 # the Free Software Foundation; either version 2 of the License, or (at
128 # your option) any later version.
130 # This program is distributed in the hope that it will be useful, but
131 # WITHOUT ANY WARRANTY; without even the implied warranty of
132 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
133 # See the GNU General Public License for more details.
135 # You should have received a copy of the GNU General Public License
136 # along with this program.
137 # If not, see L<http://www.gnu.org/licenses/>.
139 # vim: set fenc=UTF-8 ft=perl fdm=marker ts=4 sw=4 sts=4 et fo+=w :