[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp texi2any.pl
From: |
Patrice Dumas |
Subject: |
texinfo/tp texi2any.pl |
Date: |
Wed, 13 Apr 2011 20:10:49 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 11/04/13 20:10:49
Modified files:
tp : texi2any.pl
Log message:
Distinguish default options and command line options.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/texi2any.pl?cvsroot=texinfo&r1=1.30&r2=1.31
Patches:
Index: texi2any.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/texi2any.pl,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- texi2any.pl 12 Apr 2011 23:52:53 -0000 1.30
+++ texi2any.pl 13 Apr 2011 20:10:49 -0000 1.31
@@ -205,11 +205,13 @@
# passed from main program
my $cmdline_options;
+my $default_options;
# used in main program
our $options = {};
-sub _load_config ($) {
- $cmdline_options = $_[0];
+sub _load_config ($$) {
+ $default_options = shift;
+ $cmdline_options = shift;
}
sub _load_init_file($) {
@@ -230,6 +232,7 @@
return 0;
}
return 0 if (defined($cmdline_options->{$var}));
+ delete $default_options->{$var};
$options->{$var} = $value;
return 1;
}
@@ -238,6 +241,7 @@
my $var = shift;
my $value = shift;
delete $options->{$var};
+ delete $default_options->{$var};
if (!Texinfo::Common::valid_option($var)) {
warn (sprintf(main::__("Unknown variable %s\n"), $var));
return 0;
@@ -253,6 +257,8 @@
return $cmdline_options->{$var};
} elsif (exists($options->{$var})) {
return $options->{$var};
+ } elsif (exists($default_options->{$var})) {
+ return $default_options->{$var};
} else {
return undef;
}
@@ -324,13 +330,15 @@
# Others are set in the converters.
# Other relevant options (undef) are NO_WARN FORCE OUTFILE
-my $converter_default_options = {'ERROR_LIMIT' => 100};
+my $converter_default_options = { 'ERROR_LIMIT' => 100 };
+my $cmdline_options = { 'CSS_FILES' => address@hidden,
+ 'CSS_REFS' => address@hidden };
# options for all the files
my $parser_default_options = {'expanded_formats' => [], 'values' => {},
'gettext' => \&__};
-Texinfo::Config::_load_config($converter_default_options);
+Texinfo::Config::_load_config($converter_default_options, $cmdline_options);
sub set_expansion($$) {
my $region = shift;
@@ -680,6 +688,7 @@
$error_count = handle_errors($parser, $error_count);
my $converter_options = { %$converter_default_options,
+ %$cmdline_options,
%$Texinfo::Config::options };
if (defined(get_conf('OUTFILE')) and $file_number == 0) {
$converter_options->{'OUTFILE'} = get_conf('OUTFILE');
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo/tp texi2any.pl,
Patrice Dumas <=