this is just a (re)start on a tool to produce bindings cheatsheets (original was...
[ardour.git] / tools / fmt-bindings
1 #!/usr/bin/perl
2
3 $in_group_def = 0;
4 $group_name;
5 $group_text;
6 $group_key;
7 %group_names;
8 %group_text;
9
10 while (<>) {
11     next if /^\;/;
12
13     if (/^%/) {
14
15         if ($in_group_def) {
16             chop $group_text;
17             $group_names{$group_key} = $group_name;
18             $group_text{$group_key} = $group_text;
19         }
20
21         s/^%//;
22         chop;
23         ($group_key,$group_name) = split (/\s+/, $_, 2);
24         $group_text = "";
25         $in_group_def = 1;
26         next;
27     }
28
29     if ($in_group_def) {
30         next if (/^[ \t]+$/);
31         $group_text .= $_;
32         $group_text;
33         next;
34     }
35
36     next;
37 }
38
39 foreach $k (keys %group_names) {
40     print "GROUP: ", $k, " ", $group_names{$k}, "\n\t", $group_text{$k}, "\n";
41 }
42
43 exit 0;