pod2texi.pl 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. #! /usr/bin/env perl
  2. # $Id$
  3. # pod2texi -- convert Pod to Texinfo.
  4. # Copyright 2012, 2013, 2014, 2015, 2016 Free Software Foundation, Inc.
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 3 of the License,
  9. # or (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. #
  19. # Original author: Patrice Dumas <pertusus@free.fr>
  20. use strict;
  21. use Getopt::Long qw(GetOptions);
  22. # for dirname.
  23. use File::Basename;
  24. use File::Spec;
  25. Getopt::Long::Configure("gnu_getopt");
  26. #use Pod::Simple::Debug (4);
  27. BEGIN
  28. {
  29. # emulate -w
  30. $^W = 1;
  31. my ($real_command_name, $command_directory, $command_suffix)
  32. = fileparse($0, '.pl');
  33. my $datadir = '@datadir@';
  34. my $package = '@PACKAGE@';
  35. my $updir = File::Spec->updir();
  36. my $texinfolibdir;
  37. my $lib_dir;
  38. # in-source run
  39. if (($command_suffix eq '.pl' and !(defined($ENV{'TEXINFO_DEV_SOURCE'})
  40. and $ENV{'TEXINFO_DEV_SOURCE'} eq 0)) or $ENV{'TEXINFO_DEV_SOURCE'}) {
  41. my $srcdir = defined $ENV{'srcdir'} ? $ENV{'srcdir'} : $command_directory;
  42. $texinfolibdir = File::Spec->catdir($srcdir, $updir, 'tp');
  43. $lib_dir = File::Spec->catdir($texinfolibdir, 'maintain');
  44. unshift @INC, (File::Spec->catdir($srcdir, 'lib'), $texinfolibdir);
  45. } elsif ($datadir ne '@' .'datadir@' and $package ne '@' . 'PACKAGE@'
  46. and $datadir ne '') {
  47. $texinfolibdir = File::Spec->catdir($datadir, $package);
  48. # try to make package relocatable, will only work if standard relative paths
  49. # are used
  50. if (! -f File::Spec->catfile($texinfolibdir, 'Texinfo', 'Parser.pm')
  51. and -f File::Spec->catfile($command_directory, $updir, 'share',
  52. 'texinfo', 'Texinfo', 'Parser.pm')) {
  53. $texinfolibdir = File::Spec->catdir($command_directory, $updir,
  54. 'share', 'texinfo');
  55. }
  56. $lib_dir = $texinfolibdir;
  57. unshift @INC, (File::Spec->catdir($texinfolibdir, 'Pod-Simple-Texinfo'),
  58. $texinfolibdir);
  59. }
  60. # '@USE_EXTERNAL_LIBINTL @ and similar are substituted in the
  61. # makefile using values from configure
  62. if (defined($texinfolibdir)) {
  63. if ('@USE_EXTERNAL_LIBINTL@' ne 'yes') {
  64. unshift @INC, (File::Spec->catdir($lib_dir, 'lib', 'libintl-perl', 'lib'));
  65. }
  66. if ('@USE_EXTERNAL_EASTASIANWIDTH@' ne 'yes') {
  67. unshift @INC, (File::Spec->catdir($lib_dir, 'lib', 'Unicode-EastAsianWidth', 'lib'));
  68. }
  69. if ('@USE_EXTERNAL_UNIDECODE@' ne 'yes') {
  70. unshift @INC, (File::Spec->catdir($lib_dir, 'lib', 'Text-Unidecode', 'lib'));
  71. }
  72. }
  73. }
  74. use Pod::Simple::Texinfo;
  75. use Texinfo::Common;
  76. use Texinfo::Parser;
  77. use Texinfo::Transformations;
  78. {
  79. # A fake package to be able to use Pod::Simple::PullParser without generating
  80. # any output.
  81. package Pod::Simple::PullParserRun;
  82. use vars qw(@ISA);
  83. @ISA = ('Pod::Simple::PullParser');
  84. sub new
  85. {
  86. return shift->SUPER::new(@_);
  87. }
  88. sub run(){};
  89. }
  90. my ($real_command_name, $directories, $suffix) = fileparse($0);
  91. # placeholder for string translations, not used for now
  92. sub __($)
  93. {
  94. return $_[0];
  95. }
  96. sub pod2texi_help()
  97. {
  98. return __("Usage: pod2texi [OPTION]... POD...
  99. Translate Perl pod documentation file(s) to Texinfo. There are two
  100. basic modes of operation. First, by default, each pod is translated to
  101. a standalone Texinfo manual.
  102. Second, if C<--base-level> is set higher than 0, each pod is translated
  103. to a file suitable for C<\@include>, and one more file with all the
  104. C<\@include>s is generated, intended to be C<\@include>d in turn within
  105. a hand-written top-level file.
  106. Options:
  107. --appendix-sections use appendix-like sections.
  108. --base-level=NUM|NAME level of the head1 commands; default 0.
  109. --debug=NUM set debugging level.
  110. --help display this help and exit.
  111. --no-fill-section-gaps do not fill sectioning gaps.
  112. --no-section-nodes use anchors for sections instead of nodes.
  113. --output=NAME output to NAME for the first or main manual
  114. instead of standard output.
  115. --preamble=STR insert STR as beginning boilerplate.
  116. --subdir=NAME put files included in the main manual in NAME.
  117. --top top for the main manual.
  118. --unnumbered-sections use unumbered sections.
  119. --version display version information and exit.
  120. Email bug reports to bug-texinfo\@gnu.org,
  121. general questions and discussion to help-texinfo\@gnu.org.
  122. Texinfo home page: http://www.gnu.org/software/texinfo/\n");
  123. }
  124. my $base_level = 0;
  125. my $unnumbered_sections = 0;
  126. my $appendix_sections = 0;
  127. my $output = '-';
  128. my $top = 'top';
  129. my $preamble = undef;
  130. my $subdir;
  131. my $section_nodes = 1;
  132. my $fill_sectioning_gaps = 1;
  133. my $debug = 0;
  134. my $result_options = Getopt::Long::GetOptions (
  135. 'help|h' => sub { print pod2texi_help(); exit 0; },
  136. 'version|V' => sub {print "$real_command_name $Pod::Simple::Texinfo::VERSION\n\n";
  137. printf __("Copyright (C) %s Free Software Foundation, Inc.
  138. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  139. This is free software: you are free to change and redistribute it.
  140. There is NO WARRANTY, to the extent permitted by law.\n"), "2016";
  141. exit 0;},
  142. 'base-level=s' => sub {
  143. if ($_[1] =~ /^[0-4]$/) {
  144. $base_level = $_[1];
  145. } elsif (defined($Texinfo::Common::command_structuring_level{$_[1]})) {
  146. $base_level = $Texinfo::Common::command_structuring_level{$_[1]};
  147. } else {
  148. die sprintf(__("%s: wrong argument for --base-level\n"),
  149. $real_command_name);
  150. }
  151. },
  152. 'unnumbered-sections!' => \$unnumbered_sections,
  153. 'appendix-sections!' => \$appendix_sections,
  154. 'output|o=s' => \$output,
  155. 'preamble=s' => \$preamble,
  156. 'subdir=s' => \$subdir,
  157. 'top=s' => \$top,
  158. 'section-nodes!' => \$section_nodes,
  159. 'fill-section-gaps!' => \$fill_sectioning_gaps,
  160. 'debug=i' => \$debug,
  161. );
  162. exit 1 if (!$result_options);
  163. if (defined($subdir)) {
  164. if (! -d $subdir) {
  165. if (!mkdir($subdir)) {
  166. die sprintf(__("%s: could not create directory %s: %s"),
  167. $real_command_name, $subdir, $!);
  168. }
  169. }
  170. }
  171. my $STDOUT_DOCU_NAME = 'stdout';
  172. my @manuals;
  173. my @all_manual_names;
  174. my @input_files = @ARGV;
  175. # use STDIN if not a tty, like makeinfo does
  176. @input_files = ('-') if (!scalar(@input_files) and !-t STDIN);
  177. die sprintf(__("%s: missing file argument;\n"), $real_command_name)
  178. .sprintf(__("try `%s --help' for more information\n"), $real_command_name)
  179. unless (scalar(@input_files) >= 1);
  180. my @processed_files;
  181. # First gather all the manual names
  182. if ($base_level > 0) {
  183. foreach my $file (@input_files) {
  184. # we don't want to read from STDIN, as the input read would be lost
  185. # same with named pipe and socket...
  186. # FIXME are there other file that have the same problem?
  187. next if ($file eq '-' or -p $file or -S $file);
  188. # not really used, only the manual name is used.
  189. my $parser = Pod::Simple::PullParserRun->new();
  190. $parser->parse_file($file);
  191. my $short_title = $parser->get_short_title();
  192. if (defined($short_title) and $short_title =~ m/\S/) {
  193. push @manuals, $short_title;
  194. push @all_manual_names, $short_title;
  195. #print STDERR "NEW MANUAL: $short_title\n";
  196. } else {
  197. if (!$parser->content_seen) {
  198. warn sprintf(__("%s: ignoring %s without content\n"),
  199. $real_command_name, $file);
  200. next;
  201. }
  202. push @all_manual_names, undef;
  203. }
  204. push @processed_files, $file;
  205. }
  206. } else {
  207. @processed_files = @input_files;
  208. }
  209. sub _fix_texinfo_tree($$$$;$)
  210. {
  211. my $self = shift;
  212. my $manual_texi = shift;
  213. my $section_nodes = shift;
  214. my $fill_gaps_in_sectioning = shift;
  215. my $do_master_menu = shift;
  216. my $parser = Texinfo::Parser::parser();
  217. my $tree = $parser->parse_texi_text($manual_texi);
  218. if ($fill_gaps_in_sectioning) {
  219. my ($added_sections, $added_nodes);
  220. ($tree->{'contents'}, $added_sections)
  221. = Texinfo::Transformations::fill_gaps_in_sectioning($tree);
  222. # there should already be nodes associated with other sections. Therefore
  223. # new nodes should only be created for the $added_sections.
  224. if ($section_nodes) {
  225. ($tree->{'contents'}, $added_nodes)
  226. = Texinfo::Transformations::insert_nodes_for_sectioning_commands($parser, $tree);
  227. if ($self and $self->texinfo_sectioning_base_level > 0) {
  228. # prepend the manual name
  229. foreach my $node (@$added_nodes) {
  230. # First remove the old normalized entry
  231. delete $parser->{'labels'}->{$node->{'extra'}->{'normalized'}};
  232. # now get the number
  233. my $node_texi = Texinfo::Convert::Texinfo::convert(
  234. {'contents' => $node->{'extra'}->{'node_content'}});
  235. # We could have kept the asis, too, it is kept when !section_nodes
  236. $node_texi =~ s/^\s*(\@asis\{\})?\s*//;
  237. # complete with manual name
  238. my $complete_node_name = $self->_node_name($node_texi);
  239. # now recreate node arg, similar with Texinfo::Transformations::_new_node
  240. my $tree = Texinfo::Parser::parse_texi_text(undef, $complete_node_name);
  241. my $node_arg = $node->{'args'}->[0];
  242. $node_arg->{'contents'} = $tree->{'contents'};
  243. push @{$node_arg->{'contents'}},
  244. {'type' => 'spaces_at_end', 'text' => "\n"};
  245. unshift @{$node_arg->{'contents'}},
  246. {'extra' => {'command' => $node},
  247. 'text' => ' ',
  248. 'type' => 'empty_spaces_after_command'};
  249. foreach my $content (@{$node_arg->{'contents'}}) {
  250. $content->{'parent'} = $node_arg;
  251. }
  252. # Last parse and register node
  253. my $parsed_node = Texinfo::Parser::_parse_node_manual($node_arg);
  254. #push @{$node->{'extra'}->{'nodes_manuals'}}, $parsed_node;
  255. @{$node->{'extra'}->{'nodes_manuals'}} = ($parsed_node);
  256. if (!Texinfo::Parser::_register_label($parser, $node, $parsed_node, undef)) {
  257. print STDERR "BUG: node not unique, register failed: $parsed_node->{'normalized'}\n";
  258. }
  259. }
  260. }
  261. }
  262. }
  263. my $structure = Texinfo::Structuring::sectioning_structure($parser, $tree);
  264. Texinfo::Transformations::complete_tree_nodes_menus($parser, $tree)
  265. if ($section_nodes);
  266. Texinfo::Transformations::regenerate_master_menu($parser) if ($do_master_menu);
  267. return ($parser, $tree);
  268. }
  269. sub _fix_texinfo_manual($$$$;$)
  270. {
  271. my $self = shift;
  272. my $manual_texi = shift;
  273. my $section_nodes = shift;
  274. my $fill_gaps_in_sectioning = shift;
  275. my $do_master_menu = shift;
  276. my ($parser, $tree) = _fix_texinfo_tree($self, $manual_texi, $section_nodes,
  277. $fill_gaps_in_sectioning, $do_master_menu);
  278. return Texinfo::Convert::Texinfo::convert($tree);
  279. }
  280. sub _do_top_node_menu($)
  281. {
  282. my $manual_texi = shift;
  283. my ($parser, $tree) = _fix_texinfo_tree(undef, $manual_texi, 1, 0, 1);
  284. my $labels = $parser->labels_information();
  285. my $top_node_menu = $labels->{'Top'}->{'menus'}->[0];
  286. if ($top_node_menu) {
  287. return Texinfo::Convert::Texinfo::convert($top_node_menu);
  288. } else {
  289. return '';
  290. }
  291. }
  292. my $file_nr = 0;
  293. # Full manual is collected to generate the top node menu, if $section_nodes
  294. my $full_manual = '';
  295. my @included;
  296. foreach my $file (@processed_files) {
  297. my $manual_texi = '';
  298. my $outfile;
  299. my $name = shift @all_manual_names;
  300. if ($base_level == 0 and !$file_nr) {
  301. $outfile = $output;
  302. } else {
  303. if (defined($name)) {
  304. $outfile = Pod::Simple::Texinfo::_pod_title_to_file_name($name);
  305. $outfile .= '.texi';
  306. } else {
  307. if ($file eq '-') {
  308. $outfile = $STDOUT_DOCU_NAME;
  309. } else {
  310. $outfile = $file;
  311. }
  312. if ($outfile =~ /\.(pm|pod)$/) {
  313. $outfile =~ s/\.(pm|pod)$/.texi/i;
  314. } else {
  315. $outfile .= '.texi';
  316. }
  317. }
  318. $outfile = File::Spec->catfile($subdir, $outfile)
  319. if (defined($subdir));
  320. }
  321. my $new = Pod::Simple::Texinfo->new();
  322. push @included, [$name, $outfile, $file] if ($base_level > 0);
  323. my $fh;
  324. if ($outfile eq '-') {
  325. $fh = *STDOUT;
  326. } else {
  327. open (OUT, ">$outfile") or die sprintf(__("%s: could not open %s for writing: %s\n"),
  328. $real_command_name, $outfile, $!);
  329. $fh = *OUT;
  330. }
  331. # FIXME should use =encoding
  332. binmode($fh, ':encoding(utf8)');
  333. $new->output_string(\$manual_texi);
  334. $new->texinfo_sectioning_base_level($base_level);
  335. if ($section_nodes) {
  336. $new->texinfo_section_nodes(1);
  337. }
  338. if ($unnumbered_sections) {
  339. $new->texinfo_sectioning_style('unnumbered');
  340. } elsif ($appendix_sections) {
  341. $new->texinfo_sectioning_style('appendix');
  342. }
  343. if ($base_level > 0 and @manuals) {
  344. $new->texinfo_internal_pod_manuals(\@manuals);
  345. }
  346. print STDERR "processing $file -> $outfile ($name)\n" if ($debug);
  347. $new->parse_file($file);
  348. if ($section_nodes or $fill_sectioning_gaps) {
  349. if ($debug > 4) {
  350. # print to a file
  351. open (DBGFILE, ">$outfile-dbg") or die sprintf(__("%s: could not open %s: %s\n"),
  352. $real_command_name, "$outfile-dbg", $!);
  353. binmode(DBGFILE, ':encoding(utf8)');
  354. print DBGFILE $manual_texi;
  355. }
  356. $manual_texi = _fix_texinfo_manual($new, $manual_texi, $section_nodes,
  357. $fill_sectioning_gaps);
  358. $full_manual .= $manual_texi if ($section_nodes);
  359. }
  360. print $fh $manual_texi;
  361. if ($outfile ne '-') {
  362. close($fh) or die sprintf(__("%s: error on closing %s: %s\n"),
  363. $real_command_name, $outfile, $!);
  364. }
  365. if ($base_level > 0) {
  366. if (!$new->content_seen) {
  367. # this should only happen for input coming from pipe or the like
  368. warn sprintf(__("%s: removing %s as input file %s has no content\n"),
  369. $real_command_name, $outfile, $file);
  370. unlink ($outfile);
  371. pop @included;
  372. # if we didn't gather the short title, try now, and rename out file if found
  373. } elsif (!defined($name)) {
  374. my $short_title = $new->texinfo_short_title;
  375. if (defined($short_title) and $short_title =~ /\S/) {
  376. push @manuals, $short_title;
  377. pop @included;
  378. my $new_outfile
  379. = Pod::Simple::Texinfo::_pod_title_to_file_name($short_title);
  380. $new_outfile .= '.texi';
  381. $new_outfile = File::Spec->catfile($subdir, $new_outfile)
  382. if (defined($subdir));
  383. if ($new_outfile ne $outfile) {
  384. unless (rename ($outfile, $new_outfile)) {
  385. die sprintf(__("%s: rename %s failed: %s\n"),
  386. $real_command_name, $outfile, $!);
  387. }
  388. }
  389. push @included, [$short_title, $new_outfile, $file];
  390. }
  391. }
  392. }
  393. $file_nr++;
  394. }
  395. if ($base_level > 0) {
  396. my $fh;
  397. if ($output ne '-') {
  398. open (OUT, ">$output") or die sprintf(__("%s: could not open %s for writing: %s\n"),
  399. $real_command_name, $output, $!);
  400. $fh = *OUT;
  401. } else {
  402. $fh = *STDOUT;
  403. }
  404. # FIXME should use =encoding
  405. binmode($fh, ':encoding(utf8)');
  406. my $outfile_name = $output;
  407. $outfile_name = $STDOUT_DOCU_NAME if ($outfile_name eq '-');
  408. $outfile_name =~ s/\.te?x(i|info)?$//;
  409. $outfile_name .= '.info';
  410. if (! defined ($preamble)) {
  411. $preamble = '\input texinfo
  412. @setfilename ' . Pod::Simple::Texinfo::_protect_text($outfile_name) . "
  413. \@documentencoding utf-8
  414. \@settitle $top
  415. \@contents
  416. \@ifnottex
  417. \@node Top
  418. \@top $top
  419. \@end ifnottex\n\n";
  420. }
  421. print $fh $preamble;
  422. if ($section_nodes) {
  423. #print STDERR "\@node Top\n\@top top\n".$full_manual;
  424. my $menu = _do_top_node_menu("\@node Top\n\@top top\n".$full_manual);
  425. print $fh $menu."\n";
  426. }
  427. foreach my $include (@included) {
  428. my $file = $include->[1];
  429. print $fh "\@include ".Pod::Simple::Texinfo::_protect_text($file)."\n";
  430. }
  431. print $fh "\n\@bye\n";
  432. if ($output ne '-') {
  433. close($fh) or die sprintf(__("%s: error on closing %s: %s\n"),
  434. $real_command_name, $output, $!);
  435. }
  436. }
  437. if (defined($output) and $output eq '-') {
  438. close(STDOUT) or die sprintf(__("%s: error on closing stdout: %s\n"),
  439. $real_command_name, $!);
  440. }
  441. 1;
  442. __END__
  443. =head1 NAME
  444. pod2texi - convert Pod to Texinfo
  445. =head1 SYNOPSIS
  446. pod2texi [OPTION]... POD...
  447. =head1 DESCRIPTION
  448. Translate Pod file(s) to Texinfo. There are two basic modes of
  449. operation. First, by default, each pod is translated to a standalone
  450. Texinfo manual.
  451. Second, if C<--base-level> is set higher than 0, each pod is translated
  452. to a file suitable for C<@include>, and one more file with all the
  453. C<@include>s is generated, intended to be C<@include>d in turn within a
  454. hand-written top-level file.
  455. =head1 OPTIONS
  456. =over
  457. =item B<--appendix-sections>
  458. Use appendix sectioning commands (C<@appendix>, ...) instead of the
  459. default numbered sectioning Texinfo @-commands (C<@chapter>,
  460. C<@section>, ...).
  461. =item B<--base-level>=I<NUM|NAME>
  462. Sets the level of the C<head1> commands. It may be an integer or a
  463. Texinfo sectioning command (without the C<@>): 1 corresponds to the
  464. C<@chapter>/C<@unnumbered> level, 2 to the C<@section> level, and so on.
  465. The default is 0, meaning that C<head1> commands are still output as
  466. chapters, but the output is arranged as a standalone manual.
  467. If the level is not 0, the pod file is rendered as a fragment of a
  468. Texinfo manual suitable for C<@include>. In this case, each pod file
  469. has an additional sectioning command covering the entire file, one level
  470. above the C<--base-level> value. Therefore, to make each pod file a
  471. chapter in a large manual, you should use C<section> as the base level.
  472. For an example of making Texinfo out of the Perl documentation itself,
  473. see C<contrib/perldoc-all> in the Texinfo source distribution, with
  474. output available at L<http://www.gnu.org/software/perl/manual>.
  475. =item B<--debug>=I<NUM>
  476. Set debugging level to I<NUM>.
  477. =item B<--help>
  478. Display help and exit.
  479. =item B<--output>=I<NAME>
  480. Name for the first manual, or the main manual if there is a main manual.
  481. Default is to write to standard output.
  482. =item B<--no-section-nodes>
  483. Use anchors for sections instead of nodes.
  484. =item B<--no-fill-section-gaps>
  485. Do not fill sectioning gaps with empty C<@unnumbered> files.
  486. Ordinarily, it's good to keep the sectioning hierarchy intact.
  487. =item B<--preamble>=I<STR>
  488. Insert I<STR> as top boilerplate before includes. The default is a
  489. minimal beginning for a Texinfo document, and sets C<@documentencoding>
  490. to C<utf-8> (because the output is written that way).
  491. =item B<--subdir>=I<NAME>
  492. If there is a main manual with include files (each corresponding to
  493. an input pod file), then those include files are put in directory I<NAME>.
  494. =item B<--unnumbered-sections>
  495. Use unnumbered sectioning commands (C<@unnumbered>, ...) instead of the
  496. default numbered sectioning Texinfo @-commands (C<@chapter>,
  497. C<@section>, ...).
  498. =item B<--top>=I<TOP>
  499. Name of the C<@top> element for the main manual. May contain Texinfo code.
  500. =item B<--version>
  501. Display version information and exit.
  502. =back
  503. =head1 SEE ALSO
  504. L<Pod::Simple::Texinfo>. L<perlpod>. The Texinfo manual.
  505. Texinfo home page: L<http://www.gnu.org/software/texinfo/>
  506. =head1 COPYRIGHT
  507. Copyright 2016 Free Software Foundation, Inc.
  508. This program is free software; you can redistribute it and/or modify
  509. it under the terms of the GNU General Public License as published by
  510. the Free Software Foundation; either version 3 of the License,
  511. or (at your option) any later version.
  512. There is NO WARRANTY, to the extent permitted by law.
  513. =head1 AUTHOR
  514. Patrice Dumas E<lt>bug-texinfo@gnu.orgE<gt>.
  515. =cut