| #!/usr/bin/env perl | |
| # Copyright 2012-2026 Free Software Foundation, Inc. | |
| # | |
| # This program is free software; you can redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as published by | |
| # the Free Software Foundation; either version 3 of the License, | |
| # or (at your option) any later version. | |
| # | |
| # This program is distributed in the hope that it will be useful, | |
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| # GNU General Public License for more details. | |
| # | |
| # You should have received a copy of the GNU General Public License | |
| # along with this program. If not, see <https://www.gnu.org/licenses/>. | |
| # | |
| # Original author: Patrice Dumas. | |
| # | |
| # Output Texinfo customization variables | |
| use strict; | |
| BEGIN { | |
| my $mydir = $0; | |
| $mydir =~ s,/[^/]+$,,; | |
| my $t2a_srcdir = `cd $mydir/../tta && pwd`; | |
| chomp($t2a_srcdir); | |
| if (defined($ENV{'top_builddir'})) { | |
| unshift(@INC, join('/', ($ENV{'top_builddir'}, 'tta', 'perl'))); | |
| } | |
| $ENV{t2a_srcdir} = "$t2a_srcdir"; | |
| require Texinfo::ModulePath; | |
| Texinfo::ModulePath::init(undef, undef, undef); | |
| } | |
| use Texinfo::Options; | |
| use Texinfo::Common; | |
| my $do_customization_variable_commands = $ARGV[0] eq "--commands"; | |
| if ($do_customization_variable_commands) { | |
| print join("\n", | |
| sort(keys(%Texinfo::Options::multiple_at_command_options), | |
| keys(%Texinfo::Options::unique_at_command_options))); | |
| exit 0; | |
| } | |
| my %parser_customization = %Texinfo::Options::parser_options; | |
| # avoid commands by selecting only upper cased customization variables | |
| # also remove array and hash references | |
| my @parser_string_non_command_customization | |
| = grep {ref($parser_customization{$_}) eq '' and $_ =~ /^[A-Z0-9_]+$/ } | |
| keys(%parser_customization); | |
| print join("\n", | |
| sort(@parser_string_non_command_customization, | |
| keys(%Texinfo::Options::program_cmdline_options), | |
| keys(%Texinfo::Options::converter_cmdline_options), | |
| keys(%Texinfo::Options::program_customization_options), | |
| keys(%Texinfo::Options::converter_customization_options))); |