+2007-07-17 Ben Pfaff <blp@gnu.org>
+
+ * get-commands.pl: Use strict and all warnings. Simplify
+ parsing. Add "@c End:" line to output to suppress Emacs warning.
+ From bug #19335. Reviewed by John Darrington.
+
2007-06-05 Ben Pfaff <blp@gnu.org>
* Removed next, prev, up node names from @node lines, to make
#!/usr/bin/perl
# Creates Texinfo documentation from the source
-$file = $ARGV[0];
+use strict;
+use warnings 'all';
+
+my ($file) = $ARGV[0];
open(INFO, $file) || die "Cannot open \"$file\"\n" ;
print "\@c Generated from $file by get-commands.pl\n";
print "\@c Do not modify!\n\n";
print "\@table \@asis\n";
-while ($line = <INFO>)
+while (<INFO>)
{
- if ( $line =~ /^UNIMPL_CMD/ )
- {
- @fields = split(/,/,$line);
- $_ = $fields[0];
- s/^UNIMPL_CMD//;
- s/ *\(\"// ;
- s/\"//;
- $command = $_;
- $_=$fields[1];
- s/^ *\"//;
- s/\"\)//;
- chomp;
- $description = $_;
- print "\@item $command\n$description\n\n";
- }
+ my ($command, $description)
+ = /^\s*UNIMPL_CMD\s*\(\s*"([^"]*)"\s*,\s*"([^"]*)"\)\s*$/
+ or next;
+ print "\@item $command\n$description\n\n";
}
print "\@end table\n";
print "\@c Local Variables:\n";
print "\@c buffer-read-only: t\n";
+print "\@c End:\n";
close(INFO); # Close the file