9 use t
::lib
::QA
::TemplateFilters
;
11 my ( $help, $verbose, @files );
14 'v|verbose' => \
$verbose,
19 pod2usage
(1) if $help or not @files;
22 my $total = scalar @files;
23 my $num_width = length $total;
24 for my $file ( @ARGV ) {
26 print sprintf "|%-25s| %${num_width}s / %s (%.2f%%)\r",
27 '=' x
(24*$i++/$total). '>',
28 $i, $total, 100*$i/+$total;
32 my $content = read_file
( $file );
33 my $new_content = t
::lib
::QA
::TemplateFilters
::fix_filters
($content);
35 if ( $content ne $new_content ) {
36 say "$file -- Modified";
37 write_file
($file, $new_content);
44 add_missing_filters.pl - Will add the missing filters to the template files given in parameters.
48 perl misc/devel/add_missing_filters.pl **/*.tt
50 /!\ It is highly recommended to execute this script on a clean git install, with all your files and changes committed.
53 -?|--help brief help message
54 -v|--verbose verbose mode
62 Print a brief help message and exits
72 Jonathan Druart <jonathan.druart@bugs.koha-community.org>
76 Copyright 2018 Koha Development Team
80 This file is part of Koha.
82 Koha is free software; you can redistribute it and/or modify it
83 under the terms of the GNU General Public License as published by
84 the Free Software Foundation; either version 3 of the License, or
85 (at your option) any later version.
87 Koha is distributed in the hope that it will be useful, but
88 WITHOUT ANY WARRANTY; without even the implied warranty of
89 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
90 GNU General Public License for more details.
92 You should have received a copy of the GNU General Public License
93 along with Koha; if not, see <http://www.gnu.org/licenses>.