3 #==============================================================================
5 # File ID: 3c899bbc-5d49-11df-b62a-90e6ba3022ac
7 # Inserts a COMBINING LOW LINE (U+0332, "◌̲") after every character except
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 file for
14 #==============================================================================
20 use open ':std', ':encoding(UTF-8)';
37 $progname =~ s/^.*\/(.*?)$/$1/;
38 our $VERSION = '0.3.1';
40 Getopt
::Long
::Configure
('bundling');
43 'delete|d' => \
$Opt{'delete'},
44 'help|h' => \
$Opt{'help'},
45 'quiet|q+' => \
$Opt{'quiet'},
46 'space|S' => \
$Opt{'space'},
47 'strikethrough|s' => \
$Opt{'strikethrough'},
48 'verbose|v+' => \
$Opt{'verbose'},
49 'version' => \
$Opt{'version'},
51 ) || die("$progname: Option error. Use -h for help.\n");
53 $Opt{'verbose'} -= $Opt{'quiet'};
54 $Opt{'help'} && usage
(0);
55 if ($Opt{'version'}) {
64 my $combchar = "\x{0332}";
65 my $space = $Opt{'space'} ?
"" : " ";
67 if ($Opt{'strikethrough'}) {
68 $combchar = "\x{0336}";
77 s/([^\x00-\x1F$space])/$1$combchar/g;
86 # Print program version
87 print("$progname $VERSION\n");
92 # Send the help message to stdout
95 if ($Opt{'verbose'}) {
101 Usage: $progname [options] [file [files [...]]]
108 Be more quiet. Can be repeated to increase silence.
110 Use strikethrough (U+0336, '1̶2̶3̶ a̶b̶c̶') instead of underline.
112 Increase level of verbosity. Can be repeated.
114 Also underline/overstrike space characters (U+0020).
116 Print version information.
123 # Print a status message to stderr based on verbosity level
124 my ($verbose_level, $Txt) = @_;
126 $verbose_level > $Opt{'verbose'} && return;
127 print(STDERR
"$progname: $Txt\n");
133 # This program is free software; you can redistribute it and/or modify it under
134 # the terms of the GNU General Public License as published by the Free Software
135 # Foundation; either version 2 of the License, or (at your option) any later
138 # This program is distributed in the hope that it will be useful, but WITHOUT
139 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
140 # FOR A PARTICULAR PURPOSE.
141 # See the GNU General Public License for more details.
143 # You should have received a copy of the GNU General Public License along with
145 # If not, see L<http://www.gnu.org/licenses/>.
147 # vim: set fenc=UTF-8 ft=perl fdm=marker ts=4 sw=4 sts=4 et fo+=w :