]> git.saurik.com Git - bison.git/blame - build-aux/cross-options.pl
* djunpack.bat: Copyright timestamp adjusted.
[bison.git] / build-aux / cross-options.pl
CommitLineData
f4101aa6
AD
1#! /usr/bin/env perl
2
3use warnings;
4use 5.005;
5use strict;
6
7my %option;
8while (<>)
9{
10 if (/^\s*(?:(-\w), )?(--[-\w]+)(\[?)(=[-\w]+)?\]?/)
11 {
12 my ($short, $long, $opt, $arg) = ($1, $2, $3, $4);
13 $short = defined $short ? '@option{' . $short . '}' : '';
14 if ($arg)
15 {
16 $arg =~ s/^=//;
17 $arg = '@var{' . lc ($arg) . '}';
18 $arg = '[' . $arg . ']'
19 if defined $opt;
1bb2bd75 20 $option{"$long=$arg"} = $short ? "$short $arg" : '';
f4101aa6
AD
21 }
22 else
23 {
24 $option{"$long"} = "$short";
25 }
26 }
27}
28
29foreach my $long (sort keys %option)
30{
31 printf "\@item %-40s \@tab %s\n", '@option{' . $long . '}', $option{$long};
32}