X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=doc%2Fget-commands.pl;h=68a53b940d11c073adf750e54a08f797aeaa20dc;hb=4eec17311c5d0e9db3853e1550b6c8c8d0829c2c;hp=c5cd163192da7cc1754fa1587eec055b99bdf011;hpb=1195caf0c998e80d3e7195a0452a14e7b4194077;p=pspp-builds.git diff --git a/doc/get-commands.pl b/doc/get-commands.pl index c5cd1631..68a53b94 100755 --- a/doc/get-commands.pl +++ b/doc/get-commands.pl @@ -1,28 +1,25 @@ - -# +#!/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 = ) +while () { - if ( $line =~ /^UNIMPL/ ) - { - @fields = split(/,/,$line); - $_ = $fields[0]; - s/^UNIMPL//; - s/ *\(\"// ; - s/\"//; - $command = $_; - $_=$fields[5]; - s/\"//; - 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