Skip to content

Commit 0d75adb

Browse files
gemmaromquinson
authored andcommitted
Remove debug option handling from each format modules.
1 parent 6d64412 commit 0d75adb

File tree

11 files changed

+11
-28
lines changed

11 files changed

+11
-28
lines changed

lib/Locale/Po4a/AsciiDoc.pm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ sub initialize {
214214

215215
$self->{options}{'nobullets'} = 1;
216216
$self->{options}{'forcewrap'} = 0;
217-
$self->{options}{'debug'} = '';
218217
$self->{options}{'entry'} = '';
219218
$self->{options}{'macro'} = '';
220219
$self->{options}{'style'} = '';
@@ -240,8 +239,8 @@ sub initialize {
240239
$compat, 'asciidoc', 'asciidoctor' )
241240
if ( defined $compat && $compat ne "asciidoc" && $compat ne "asciidoctor" );
242241

243-
if ( $options{'debug'} ) {
244-
foreach ( $options{'debug'} ) {
242+
if ( $self->{options}{debug} ) {
243+
foreach ( $self->{options}{debug} ) {
245244
$debug{$_} = 1;
246245
}
247246
}

lib/Locale/Po4a/Man.pm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,6 @@ sub initialize {
470470
my $self = shift;
471471
my %options = @_;
472472

473-
$self->{options}{'debug'} = '';
474473
$self->{options}{'groff_code'} = '';
475474
$self->{options}{'untranslated'} = '';
476475
$self->{options}{'noarg'} = '';
@@ -491,8 +490,8 @@ sub initialize {
491490
}
492491

493492
%debug = ();
494-
if ( defined $options{'debug'} ) {
495-
foreach ( $options{'debug'} ) {
493+
if ( $self->{options}{'debug'} ) {
494+
foreach ( $self->{options}{'debug'} ) {
496495
$debug{$_} = 1;
497496
}
498497
}

lib/Locale/Po4a/Org.pm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,13 @@ sub initialize {
3737
$self->{options}{skip_keywords} = [];
3838
$self->{options}{skip_properties} = [];
3939
$self->{options}{skip_heading} = 0;
40-
$self->{options}{debug} = 0;
4140

4241
foreach my $opt ( keys %options ) {
4342
exists $self->{options}{$opt}
4443
or die wrap_mod( 'po4a::org', dgettext( 'po4a', 'Unknown option: %s' ), $opt );
4544
}
4645

4746
$self->{options}{skip_heading} = $options{skip_heading};
48-
$self->{options}{debug} = $options{debug};
4947

5048
foreach my $option_name ( 'skip_keywords', 'skip_properties' ) {
5149
my $option = $options{$option_name} or next;

lib/Locale/Po4a/RubyDoc.pm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ sub initialize {
6464
my $self = shift;
6565
my %options = @_;
6666

67-
$self->{options}{'debug'} = 1;
6867
$self->{options}{'puredoc'} = 0;
6968

7069
foreach my $opt ( keys %options ) {

lib/Locale/Po4a/Sgml.pm

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,17 +255,15 @@ sub initialize {
255255

256256
$self->{options}{'force'} = '';
257257

258-
$self->{options}{'debug'} = '';
259-
260258
foreach my $opt ( keys %options ) {
261259
if ( $options{$opt} ) {
262260
die wrap_mod( "po4a::sgml", dgettext( "po4a", "Unknown option: %s" ), $opt )
263261
unless exists $self->{options}{$opt};
264262
$self->{options}{$opt} = $options{$opt};
265263
}
266264
}
267-
if ( $options{'debug'} ) {
268-
foreach ( split /\s+/, $options{'debug'} ) {
265+
if ( $self->{options}{'debug'} ) {
266+
foreach ( split /\s+/, $self->{options}{'debug'} ) {
269267
die wrap_mod( "po4a::sgml", dgettext( "po4a", "Unknown debug category: %s. Known categories:\n%s" ),
270268
$_, join( " ", keys %debug ) )
271269
unless exists $debug{$_};

lib/Locale/Po4a/TeX.pm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,7 +1632,6 @@ sub initialize {
16321632
$self->{options}{'exclude_include'} = '';
16331633
$self->{options}{'no_wrap'} = '';
16341634
$self->{options}{'verbatim'} = '';
1635-
$self->{options}{'debug'} = '';
16361635
$self->{options}{'no-warn'} = 0; # TexInfo option to not warn about the state of the module
16371636

16381637
%debug = ();
@@ -1648,8 +1647,8 @@ sub initialize {
16481647
}
16491648
}
16501649

1651-
if ( $options{'debug'} ) {
1652-
foreach ( $options{'debug'} ) {
1650+
if ( $self->{options}{'debug'} ) {
1651+
foreach ( $self->{options}{'debug'} ) {
16531652
$debug{$_} = 1;
16541653
}
16551654
}

lib/Locale/Po4a/Text.pm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ sub initialize {
221221
$self->{options}{'control'} = "";
222222
$self->{options}{'breaks'} = 1;
223223
$self->{options}{'debianchangelog'} = 1;
224-
$self->{options}{'debug'} = 1;
225224
$self->{options}{'fortunes'} = 1;
226225
$self->{options}{'markdown'} = 1;
227226
$self->{options}{'yfm_keys'} = '';

lib/Locale/Po4a/TransTractor.pm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ sub new {
377377
$self->{options}{'wrap-po'} = '';
378378
$self->{options}{'wrapcol'} = '';
379379
$self->{options}{'verbose'} = delete $options{verbose};
380+
$self->{options}{'debug'} = delete $options{debug};
380381
my $context_module = delete $options{context_module};
381382

382383
# let the plugin parse the options and such
@@ -404,8 +405,8 @@ sub new {
404405
if ( defined $self->{options}{verbose} ) {
405406
$self->{TT}{verbose} = $self->{options}{verbose};
406407
}
407-
if ( defined $options{'debug'} ) {
408-
$self->{TT}{debug} = $options{'debug'};
408+
if ( defined $self->{options}{'debug'} ) {
409+
$self->{TT}{debug} = $self->{options}{'debug'};
409410
}
410411
if ( defined $options{'wrapcol'} ) {
411412
if ( $options{'wrapcol'} < 0 ) {

lib/Locale/Po4a/VimHelp.pm

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ use warnings;
2929

3030
use parent qw(Locale::Po4a::TransTractor);
3131

32-
sub initialize {
33-
my ( $self, %options ) = @_;
34-
$self->{debug} = $options{debug};
35-
return;
36-
}
37-
3832
sub parse {
3933
my $self = shift;
4034

lib/Locale/Po4a/Xml.pm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,6 @@ sub initialize {
594594
$self->{options}{'ontagerror'} = "fail";
595595
$self->{options}{'cpp'} = 0;
596596

597-
$self->{options}{'debug'} = '';
598-
599597
foreach my $opt ( keys %options ) {
600598
if ( $options{$opt} ) {
601599
die wrap_mod( "po4a::xml::initialize", dgettext( "po4a", "Unknown option: %s" ), $opt )

0 commit comments

Comments
 (0)