mdisk: Delete unnecessary use of `strip_diskname` and use it elsewhere
[sunny256-utils.git] / strip_msgstr
bloba2b8cc154d48f8249daa60e90166efd00dbf6a9b
1 #!/usr/bin/env perl
3 #=======================================================================
4 # strip_msgstr
5 # File ID: 8806a55c-5d45-11df-8c3b-90e6ba3022ac
6 # Stripper bort oversettelser i .po-filer for å se om det er noe grums
7 # som har oppstått der.
8 #=======================================================================
10 use strict;
11 use warnings;
13 $| = 1;
15 use Getopt::Std;
16 our ($opt_h, $opt_o) =
17 ( 0, 0);
18 getopts('ho') || die("Option error. Use -h for help.\n");
20 $opt_h && usage(0);
22 my $Print = 1;
24 my $Keep = $opt_o ? "msgstr" : "msgid";
25 my $Strip = $opt_o ? "msgid" : "msgstr";
27 while (<>) {
28 if (/^$Keep/ || /^$/) {
29 $Print = 1;
31 elsif (/^$Strip/) {
32 $Print = 0;
34 $Print && print;
37 sub usage {
38 # Send the help message to stdout {{{
39 my $Retval = shift;
40 print(<<END);
42 Usage: strip_msgstr [options] [file [...]]
44 Strips translations from po files so potential nasty things can be
45 found.
47 Options:
49 -o Strip original text instead.
51 END
52 exit($Retval);
53 # }}}
56 # vim: set ts=4 sw=4 sts=4 et :