Generate the long/short option cross-table.

* build-aux/cross-options.pl: New.
* doc/Makefile.am (cross-options.texi): New.
* doc/bison.texinfo: Use it.
This commit is contained in:
Akim Demaille
2007-11-04 21:15:11 +00:00
parent 727a14014b
commit f4101aa612
3 changed files with 97 additions and 71 deletions

View File

@@ -1,3 +1,10 @@
2007-11-04 Akim Demaille <demaille@gostai.com>
Generate the long/short option cross-table.
* build-aux/cross-options.pl: New.
* doc/Makefile.am (cross-options.texi): New.
* doc/bison.texinfo: Use it.
2007-11-04 Akim Demaille <demaille@gostai.com>
Generate bison.1 using help2man.

32
build-aux/cross-options.pl Executable file
View File

@@ -0,0 +1,32 @@
#! /usr/bin/env perl
use warnings;
use 5.005;
use strict;
my %option;
while (<>)
{
if (/^\s*(?:(-\w), )?(--[-\w]+)(\[?)(=[-\w]+)?\]?/)
{
my ($short, $long, $opt, $arg) = ($1, $2, $3, $4);
$short = defined $short ? '@option{' . $short . '}' : '';
if ($arg)
{
$arg =~ s/^=//;
$arg = '@var{' . lc ($arg) . '}';
$arg = '[' . $arg . ']'
if defined $opt;
$option{"$long=$arg"} = "$short $arg";
}
else
{
$option{"$long"} = "$short";
}
}
}
foreach my $long (sort keys %option)
{
printf "\@item %-40s \@tab %s\n", '@option{' . $long . '}', $option{$long};
}

View File

@@ -7861,20 +7861,7 @@ the corresponding short option.
@multitable {@option{--defines=@var{defines-file}}} {@option{-b @var{file-prefix}XXX}}
@headitem Long Option @tab Short Option
@item @option{--debug} @tab @option{-t}
@item @option{--defines=@var{defines-file}} @tab @option{-d}
@item @option{--file-prefix=@var{prefix}} @tab @option{-b @var{file-prefix}}
@item @option{--graph=@var{graph-file}} @tab @option{-d}
@item @option{--help} @tab @option{-h}
@item @option{--name-prefix=@var{prefix}} @tab @option{-p @var{name-prefix}}
@item @option{--no-lines} @tab @option{-l}
@item @option{--output=@var{outfile}} @tab @option{-o @var{outfile}}
@item @option{--print-localedir} @tab
@item @option{--print-datadir} @tab
@item @option{--token-table} @tab @option{-k}
@item @option{--verbose} @tab @option{-v}
@item @option{--version} @tab @option{-V}
@item @option{--yacc} @tab @option{-y}
@include cross-options.texi
@end multitable
@node Yacc Library